ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to format text (https://www.excelbanter.com/excel-programming/376562-macro-format-text.html)

JN[_7_]

Macro to format text
 
Hi,

I have a few thousand rows that are paired like the following:

1ab ][ 128103406101993004040000
10.90.134.2 | 00:0E:5C:E6:CA:AA

What i would like is to have just one row in the following format:

A1 B1 C1
D1
1ab 10.90.134.2 00:0E:5C:E6:CA:AA 128134...

Thanks for your help.
JN



ron b

Macro to format text
 
Use the text to column function

Columns("A:A").Select
Selection.TextToColumns Destination:=Range("A1"),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 2), Array(3, 9), Array(6, 2), Array(31, 9), _
Array(32, 2), Array(43, 9), Array(46, 2), Array(63, 9)), _
TrailingMinusNumbers:=True


"JN" wrote:

Hi,

I have a few thousand rows that are paired like the following:

1ab ][ 128103406101993004040000
10.90.134.2 | 00:0E:5C:E6:CA:AA

What i would like is to have just one row in the following format:

A1 B1 C1
D1
1ab 10.90.134.2 00:0E:5C:E6:CA:AA 128134...

Thanks for your help.
JN





All times are GMT +1. The time now is 03:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com