使用Excel VBA将数据对齐到行

时间:2013-01-05 09:31:23

标签: excel vba

我需要使用VBA将这些数据与Excel中的行对齐。我有这种格式的大量数据。我需要把它变成行

SUBSCRIBER DETAILS
IMSI             MSISDN           STATE
405845001382775  919085919027     IDLE

DATE             TIME             CELLID
130103           122725           404-29-12906-15353

IMEI
356395024630200

SUBSCRIBER DETAILS
IMSI             MSISDN           STATE
405845002463183  919085325090     IDET

DATE             TIME             CELLID
130103           103447           404-29-12107-23993

IMEI
354917031429730

必需的输出: -

IMSI        MSISDN           STATE  DATE             TIME             CELLID            DATE             TIME             CELLID            IMEI
405845001382775  919085919027     IDLE              130103           122725           404-29-12906-15353            356395024630200
IMSI             MSISDN           STATE DATE             TIME             CELLID            DATE             TIME             CELLID            IMEI
405845002463183  919085325090     IDET              130103           103447           404-29-12107-23993            354917031429730

1 个答案:

答案 0 :(得分:0)

以下是您要查找的细分。选择范围后,根据需要使用。每种类型的Alignment都与“With Statement”一起使用

With Selection
    .HorizontalAlignment = xlLeft
    .HorizontalAlignment = xlCenter
    .HorizontalAlignment = xlRight
    .VerticalAlignment = xlTop
    .VerticalAlignment = xlCenter
    .VerticalAlignment = xlBottom
End With