As my VBA knowledge isn't extensive, I usually Record the macros I need. As I have columns with both Date and Time in the same cell, I used Excel's 'Text to Columns' feature and recorded it, coming up with the code below. However once there is a blank cell in any row, all the cells below that do not get formatted!
In my searching, I've found that the solution is based looping the code to perform the action cell by cell but I haven't found how to do what's needed using that, plus looks extremely complex!
I'm asking if there's a way to ignore the blank cells and continue with the formatting.
This is the Text to Column code but is there code I can add before or after to ignore the blank cells and still keep the code below?
Columns("S:S").Select
Selection.Insert Shift:=xlToRight
Range("R2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.TextToColumns Destination:=Range("R2"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 2), Array(9, 1)), TrailingMinusNumbers:=True
Columns("S:S").Select
Selection.Delete Shift:=xlToLeft
Columns("T:T").Select
Selection.Insert Shift:=xlToRight
Range("S2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.TextToColumns Destination:=Range("S2"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 2), Array(9, 1)), TrailingMinusNumbers:=True
Columns("T:T").Select
Selection.Delete Shift:=xlToLeft
Columns("U:U").Select
Selection.Insert Shift:=xlToRight
Range("T2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.TextToColumns Destination:=Range("T2"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 2), Array(9, 1)), TrailingMinusNumbers:=True
Columns("U:U").Select
Selection.Delete Shift:=xlToLeft