PDA

View Full Version : [SOLVED:] Defining Variables



Aussiebear
05-01-2024, 07:48 PM
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

June7
05-01-2024, 08:45 PM
It's an old way of declaring a long data type. https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/s9cz43ek(v=vs.100)?redirectedfrom=MSDN

Aussiebear
05-02-2024, 02:50 AM
Thank you June7. Some habits die hard with programmers I guess.