Results 1 to 3 of 3

Thread: Defining Variables

  1. #1
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,104
    Location

    Defining Variables

    I recently came across this section of code and was wondering what these variables represent?

    Sub Demo1()
      Const F = "IF(ISNUMBER(Q#:U#),IF(MONTH(Q#:U#)=MONTH(I#),ADDRESS(#,COLUMN(Q#:U#))))"
        Dim L&, R&, V
            L = UsedRange.Rows.Count
            Application.ScreenUpdating = False
            Range("I2:I" & L & ",Q2:U" & L).Interior.ColorIndex = xlNone
        For R = 2 To L
            V = Filter(Evaluate(Replace(F, "#", R)), False, False)
            If UBound(V) > -1 Then Range("I" & R & "," & Join(V, ",")).Interior.ColorIndex = 6
        Next
           Application.ScreenUpdating = True
    End Sub
    The code works as intended ( highlights all dates within the range Q, R, S, T &U to last row, that matches (same month) of a date in Column I.

    I am curious about the L&, R& designations
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  2. #2
    VBAX Mentor
    Joined
    Nov 2022
    Location
    The Great Land
    Posts
    344
    Location
    It's an old way of declaring a long data type. https://learn.microsoft.com/en-us/pr...ectedfrom=MSDN
    How to attach file: Reading and Posting Messages (vbaexpress.com), click Go Advanced below post edit window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,104
    Location
    Thank you June7. Some habits die hard with programmers I guess.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

Tags for this Thread

Posting Permissions

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