larinda4
Board Regular
- Joined
- Nov 15, 2021
- Messages
- 73
- Office Version
- 365
- Platform
- Windows
Thank you for any help.
I have a rather large data dump I receive and I have to search column E for the word "to". If it comes up, I need the value to the right of the cell (column F) to be moved up 1 row (copy and paste or cut and paste, either one) and then continue searching column E for any other "to"'s.
It sounds very simple but I'm having a hard time finding a code for this.
Here's my code:
I appreciate the help.
I have a rather large data dump I receive and I have to search column E for the word "to". If it comes up, I need the value to the right of the cell (column F) to be moved up 1 row (copy and paste or cut and paste, either one) and then continue searching column E for any other "to"'s.
It sounds very simple but I'm having a hard time finding a code for this.
Here's my code:
VBA Code:
Sub Format_DFG()
Dim cell As Range
Application.ScreenUpdating = False
For Each cell In Range("E1:E" & Cells(Rows.Count, "E").End(xlUp).Row)
If InStr(cell.Text, "to") > 0 Then
cell.Offset(1, 0) = cell.Text
cell.ClearContents
End If
Next cell
Application.ScreenUpdating = True
End Sub
I appreciate the help.
Last edited by a moderator: