ARUNCHENNAI
Board Regular
- Joined
- Apr 24, 2017
- Messages
- 66
What's the error in the below code.
Cells(x, 1).Offset(0, 2) = Range("A3").Value
is not at all getting executed.
Cells(x, 1).Offset(0, 2) = Range("A3").Value
is not at all getting executed.
Code:
Sub record_dailystock()
Dim x, myref As Range
Dim lr As Long
Dim wb As Workbook
Dim ws As Worksheet
Set wb = ThisWorkbook
Set ws = wb.Worksheets("Backend")
lr = Cells(Rows.Count, "T").End(xlUp).Row
Set myref = ws.Range("T3:T" & lr)
'On Error Resume Next
For Each x In myref
If Cells(x, 1) = Date Then
Cells(x, 1).Offset(0, 2) = Range("A3").Value
End If
Next x
End Sub
Last edited: