I have a spreadsheet which imports data files, and each file has a cell that has the word "Sample" .
I would like VBA code to find and replace each instance of the word "Sample" with the 'Title1', then 'Title2', then 'Title3' etc.
I was working with the code below to try add sequence numbers, but it's not quite working right, and I know the answer is simple.
Any help would be awesome.
Sub Numbers()
Dim ged As Variant
Dim b As Range
ged = "Sample"
For Each b In ActiveSheet.Range("A1:A")
k = 1
i = k + 1
If b.Value = ged _
Then b.Value = "Title" & i + 1
Next b
End Sub
Bookmarks