Results 1 to 11 of 11

Thread: Where and how to enter an Excel formula

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,446
    Location
    Private Sub Worksheet_Change(ByVal Target As Range)
        Const WS_RANGE As String = "A:A" '<== change to suit
        Const ADD_FORMULA = "=IF(M<rownum><>"""",""Returned"",IF(AND(TODAY()>=K<rownum>+8,M<rownum>=""""),""Require Chasing"",""No Action Required""))"
        On Error GoTo ws_exit
        Application.EnableEvents = False
        If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
            With Target
                If .Value <> "" Then
                    Me.Cells(.Row, "N").Formula = Replace(ADD_FORMULA, "<rownum>", .Row)
                End If
            End With
        End If
        ws_exit:
        Application.EnableEvents = True
    End Sub
    Last edited by Aussiebear; 12-18-2024 at 04:10 AM.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •