Dear Friendly Learned People, I want to search Column B for the word "shelf". When it is found, do "Text To Columns" on the cell 1 row down and 1 column to the right from the cell where the word was found. e.g. if "shelf" is found in B23, then execute "Text To Columns" on cell C24. BUT ONLY IF B24 is empty. If B24 is not empty, continue search. approximately 1200 rows.
I am sure that this can be done, but by persons more clever than I.
I will be so grateful and I thank you in advance
Kind regards
Andy
>>
'search for "shelf"
Application.DisplayAlerts = False
Set rng = Range("B2:B1500") ' (RANGE TO SEARCH)
specificText = "Shelf" ' (text to search for)
For Each cell In rng.Cells
If UCase(cell.Value) Like "*" & UCase(specificText) & "*" Then
cell.Offset(1, -1).Select
Selection.Delete
'
Selection.TextToColumns Destination:=cell.Offset(0, 1).Select, DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(5, 1), Array(7, 1), Array(11, 1), Array(18, 1), _
Array(20, 1), Array(23, 1), Array(33, 1), Array(35, 1), Array(38, 1)), _
TrailingMinusNumbers:=True
End If
Next
I am sure that this can be done, but by persons more clever than I.
I will be so grateful and I thank you in advance
Kind regards
Andy
>>
'search for "shelf"
Application.DisplayAlerts = False
Set rng = Range("B2:B1500") ' (RANGE TO SEARCH)
specificText = "Shelf" ' (text to search for)
For Each cell In rng.Cells
If UCase(cell.Value) Like "*" & UCase(specificText) & "*" Then
cell.Offset(1, -1).Select
Selection.Delete
'
Selection.TextToColumns Destination:=cell.Offset(0, 1).Select, DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(5, 1), Array(7, 1), Array(11, 1), Array(18, 1), _
Array(20, 1), Array(23, 1), Array(33, 1), Array(35, 1), Array(38, 1)), _
TrailingMinusNumbers:=True
End If
Next