vzachin
09-01-2006, 09:22 AM
Hi,
I have 2 questions
The 1st question I have if there is no data in Column B5, this will fail. How can I skip the TextToColumns if there is no data in Column B5
Range("B5:B65536").Select
Selection.TextToColumns Destination:=Range("B5"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(15, 1), Array(35, 1), Array(55, 1))
The 2nd question is instead of using Range("B5:B65536").Select, i tried to find the last row, but i don't quite understand how to write the code correctly to select B5 to last row in column B5.
iLastRow = Cells(Rows.Count, 1).End(xlUp).Row
Rows("5:" & iLastRow + 1).SpecialCells(xlCellTypeVisible).Select
Selection.TextToColumns Destination:=Range("B5"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(15, 1), Array(35, 1), Array(55, 1))
thanks
zach
I have 2 questions
The 1st question I have if there is no data in Column B5, this will fail. How can I skip the TextToColumns if there is no data in Column B5
Range("B5:B65536").Select
Selection.TextToColumns Destination:=Range("B5"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(15, 1), Array(35, 1), Array(55, 1))
The 2nd question is instead of using Range("B5:B65536").Select, i tried to find the last row, but i don't quite understand how to write the code correctly to select B5 to last row in column B5.
iLastRow = Cells(Rows.Count, 1).End(xlUp).Row
Rows("5:" & iLastRow + 1).SpecialCells(xlCellTypeVisible).Select
Selection.TextToColumns Destination:=Range("B5"), DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(15, 1), Array(35, 1), Array(55, 1))
thanks
zach