0

I am trying to seperate my columns with vba. This is how my data looks:

first row:

Time,[CB:01:4A:7D:06:2D] Thermometer_0,[E5:39:8E:7F:E4:11] Thermometer_0,[F1:89:F8:3A:EA:63] Thermometer_0,[F7:C6:4A:56:E4:23] Thermometer_0

second row:

11/23/2021 10:50,,,,20.9

That means that I need to have 11/23/2021 10:50 in the first column (Time), second, third and fourth are empty, and in the fifth value 20.9. There are variations for the second row.

Currently I am trying with this code:

Sub TextToCol3()
   Range("A1:A135").TextToColumns , xlDelimited, xlDoubleQuote, True, , , True, True, True
End Sub

But this just ignore the empty spaces between commas, and creates only two columns.

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
Eva
  • 9
  • 6
  • You should be good to use the named parameters to see where the consecutive Delimiter one appears... – FaneDuru Nov 23 '21 at 11:09

1 Answers1

0

Please, test the next way:

Range("A1:A135").TextToColumns DataType:=xlDelimited, ConsecutiveDelimiter:=False, Comma:=True

If ConsecutiveDelimiter = True, the consecutive delimiters are considered as one delimiter...

FaneDuru
  • 38,298
  • 4
  • 19
  • 27