Forum Discussion
Samarth1508
Mar 17, 2023Copper Contributor
VBA code to change column data
Hi All,
I am trying below code to change value of another column but getting error as type mismatch.
Sub Update_Data()
Dim lr As Long
lr = Sheet2.Range("J" & Rows.Count).End(xlUp).Row
If Not IsEmpty(Sheet2.Range("J2:J" & lr).Value) Then Sheet2.Range("I2:I" & lr).Value =IIf(Left(Sheet2.Range("J2:J" & lr).Value, 4) = "SBIN", "IFT", "NEFT")
End Sub
8 Replies
Sort By