Scorpion Steve
Board Regular
- Joined
- Jun 5, 2011
- Messages
- 220
Hi all.
I am trying to work out how to nest offset in a code using search replace.
The goal is to find a value from cell A1 (example) and replace the values in the cells next to the cell containing samuel and the cell containing samuel.
A sort of search and remove data tool if you like
So for example:
I am trying to work out how to nest offset in a code using search replace.
The goal is to find a value from cell A1 (example) and replace the values in the cells next to the cell containing samuel and the cell containing samuel.
A sort of search and remove data tool if you like
So for example:
A1: "samuel" (the search criteria)
Search range is: B1:D400
(for example)
Cell B40 = samuel
C40 = Driver
D40 = year
So, the macro is activated and finds "samuel" in B40 and I would like C40 & D40 replaced with ""
The code I'm using is below: (this is just replacing the cell containing the search criteria with "test".
I would like to nest offset(0,2) & offset(0,3).Value = ""
ThanksSub Macro1()
Range("B1:D400").Select
Selection.Replace What:=Sheets("Sheet1").Range("A1").Value, Replacement:="test", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub