L
Legacy 93538
Guest
Hi
I need some help with a find and replace statement i am trying to create. The code below should loop through the D column (which has values similar to this "'=G4+H4+I4+J4+K4+L4+M4+N4+O4+P4+Q4+R4"), it should then look in the cell value and for each cell ref it finds, it looks that cell ref up in the M column and replaces the cell ref with the value in the corresponing row in column L.
I have been using the following code but when it runs, it doesn't replace any of the cell refs, prehaps beacuse its looking at the value as a whole but i am not sure.
Does anyone know of an easier way of doing this?
Thank you
Jessicaseymour
I need some help with a find and replace statement i am trying to create. The code below should loop through the D column (which has values similar to this "'=G4+H4+I4+J4+K4+L4+M4+N4+O4+P4+Q4+R4"), it should then look in the cell value and for each cell ref it finds, it looks that cell ref up in the M column and replaces the cell ref with the value in the corresponing row in column L.
I have been using the following code but when it runs, it doesn't replace any of the cell refs, prehaps beacuse its looking at the value as a whole but i am not sure.
Code:
For Y = 1 To Z
FindRef = Range("M" & 1 + Z) 'First loop with substitute values
ReplRef = Range("L" & 1 + Z)
Set MyRange = PPCWBSht.Range("D:D")
MyRange.Replace What:=FindRef, Replacement:=ReplRef, LookAt:=xlPart, SearchOrder:=xlByRows, _
MatchCase:=True, SearchFormat:=False, ReplaceFormat:=False
Next Y
Does anyone know of an easier way of doing this?
Thank you
Jessicaseymour