vb
Posted: Sun Jan 01, 2023 2:33 pm
Hi dear
I need your help how to fix my VBA code without using helper column to fetch data from cell c2 and save .
I need your help how to fix my VBA code without using helper column to fetch data from cell c2 and save .
Code: Select all
Sub test()
Dim lr As long ,s As String,X As Long
lr=Sheet1.Cells(Sheet1.Rows.Count,1).End(xlUp).Row+1
s=Sheet1.Range("B2").Text
X=Application.Match(s,Sheet1.Range("A:A"),0)
Sheet1.Range("D"& X).Value=Sheet1.Range("C2").Value
Msgbox "data saved!"
[B2:C2].Clearcontents
End Sub