Ger Plante Administrator

  • Member since Jun 16th 2005
  • Last Activity:
Posts
5,326
Likes Received
1
Points
16,173
Trophies
2
Profile Hits
3,039
  • 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.


    Sub 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

  • lost access to my old account how do i get access

    ashu1990

  • Hello My Dear