Winchester1894
New Member
- Joined
- Jan 20, 2018
- Messages
- 2
How do you do Friends,
I have a large data set and I would like to search for a keyword and update the cell 5 columns over from it.
This is what I have so far:
This code works but only for the first instance of the desired change. I would like it to run down the entire column and perform the edit. I tried adding a for loop but it only looped changing the first instance. What am I missing to make it run for the entirety of the column?
Any help appreciated, thank you.
I have a large data set and I would like to search for a keyword and update the cell 5 columns over from it.
This is what I have so far:
Code:
Sub Find_and_Write()
Dim X As Variant, F As Range
X = Application.InputBox("Enter Value")
If TypeName(X) = "Boolean" Then Exit Sub
Set F = Columns("C").Find(what:="C-1290", LookIn:=xlValues, lookat:=xlWhole)
If Not F Is Nothing Then F.Offset(, 5).Value = X
End Sub
This code works but only for the first instance of the desired change. I would like it to run down the entire column and perform the edit. I tried adding a for loop but it only looped changing the first instance. What am I missing to make it run for the entirety of the column?
Any help appreciated, thank you.