Hello to all of you,
I am woking on one small excel spreadsheet on my job and in the process I need to change in column A clients name( this is bank name) on "regardless" based on value of cells in column J(value in column J is "2" or "4" in order to bank to change to "Regardless" in column A ). I have written a macro to do that, but it doesn't work;
Dim c5 As Range
Dim Lastrow1 as Range
Dim SrchRng5
Dim Bcell As Range
Lasrow1=Cells(Rows.Count, "A").End(xlUp).Row
Do
Set Bcell = ActiveSheet.Range("A1", ActiveSheet.Range("A1:A" & Lastrow1).End(xlUp))
Set SrchRng5 = ActiveSheet.Range("J1", ActiveSheet.Range("J1:J" & Lastrow1).End(xlUp))
Set c5 = SrchRng5.Find("2", LookIn:=xlValues)
If Not c5 Is Nothing Then Bcell.Value = "Regardless"
Loop While Not c5 Is Nothing.
I don't know what I have done wrong in the macro.It is relly would easy my job if you point me where mistake is.
THANK YOU in advanc eforyour help.
Best Reagrds,
BorisGomel
.
I am woking on one small excel spreadsheet on my job and in the process I need to change in column A clients name( this is bank name) on "regardless" based on value of cells in column J(value in column J is "2" or "4" in order to bank to change to "Regardless" in column A ). I have written a macro to do that, but it doesn't work;
Dim c5 As Range
Dim Lastrow1 as Range
Dim SrchRng5
Dim Bcell As Range
Lasrow1=Cells(Rows.Count, "A").End(xlUp).Row
Do
Set Bcell = ActiveSheet.Range("A1", ActiveSheet.Range("A1:A" & Lastrow1).End(xlUp))
Set SrchRng5 = ActiveSheet.Range("J1", ActiveSheet.Range("J1:J" & Lastrow1).End(xlUp))
Set c5 = SrchRng5.Find("2", LookIn:=xlValues)
If Not c5 Is Nothing Then Bcell.Value = "Regardless"
Loop While Not c5 Is Nothing.
I don't know what I have done wrong in the macro.It is relly would easy my job if you point me where mistake is.
THANK YOU in advanc eforyour help.
Best Reagrds,
BorisGomel
.