Posts by ShaileshK
-
-
Hi,
Please help me on below code. When I run this code I haven't get any error, but at the same time not getting any result too.
Code
Display MoreSub New_Method() 'If date in coloum C is less than today and cell in coloum E is blank (in the same row), then fill that blank cell with "my text" in coloum E. Dim rng As Range Dim sh As Worksheet Dim lastrow As Long lastrow = Range("C" & Rows.Count).End(xlUp).Row Set sh = ThisWorkbook.Worksheets("Entry Page") 'Set the range in column C you want to loop through Set rng = sh.Range("C2" & lastrow) With Worksheets("Entry Page") For Each Cell In rng 'test if cell is empty If Cell.Value < Date And Cell.Offset(0, 2) = "" Then 'write to adjacent cell Cell.Offset(0, 2).Value = "My Text" End If Next End With End Sub