Forum Discussion
JamesPhImp
Jul 27, 2023Copper Contributor
VBA code to find and replace in each row based on cell value
Hi I need a VBA code that will cycle through a sheet and do the following. highlight the row and do a find and replace for that row, find the value in column B and replace with the value in column C...
HansVogelaar
Jul 27, 2023MVP
No need to loop through the rows. You can do it in one go:
Sub C2B()
Dim LastRow As Long
Application.ScreenUpdating = False
LastRow = Range("A" & Rows.Count).End(xlUp).Row
Range("B2:B" & LastRow).Value = Range("C2:C" & LastRow).Value
Application.ScreenUpdating = True
End Sub