Hello,
No biggie here and again, I must note I am not a programmer so please bear with me if you please.
I was wondering if there is a preference on which coding is more common or acceptable. My worksheet has a few routines that address the status of conditions that change. I have worked on this in two fashions.
1. I place the values that change in cells (P29,Q29,S29), then call the cells/values accordingly as they are needed. This causes the cells to routinely be changing.
2. I create variables; then call the variables in each routine. This does not require any cells to be populated. However, because I address this in numerous subs, I have to add the variable conditions in each sub.
Is one of the above more applicable etc.?
Here is a snip-it of my code:
Thanks for viewing,
Steve
No biggie here and again, I must note I am not a programmer so please bear with me if you please.
I was wondering if there is a preference on which coding is more common or acceptable. My worksheet has a few routines that address the status of conditions that change. I have worked on this in two fashions.
1. I place the values that change in cells (P29,Q29,S29), then call the cells/values accordingly as they are needed. This causes the cells to routinely be changing.
2. I create variables; then call the variables in each routine. This does not require any cells to be populated. However, because I address this in numerous subs, I have to add the variable conditions in each sub.
Is one of the above more applicable etc.?
Here is a snip-it of my code:
VBA Code:
Public Sub EscrowSetup()
Application.ScreenUpdating = False
Range("P29:V29").ClearContents
Dim YearDUE1 As Long
Dim YearDUE2 As Long
Dim YearPITI_2 As Long
Dim yearDIST As Long
If Range("M33") > 0 Then
YearDUE1 = Year(Range("M32").End(xlDown).Offset(0, -10))
YearDUE2 = Year(Range("M32").End(xlDown).Offset(1, -10))
If Range("T33") > 0 Then
yearDIST = Range("$T$2222").End(xlUp).Offset(0, -2).Copy
Range("V29").PasteSpecial Paste:=xlPasteValues '-- for YearDIST --
Range("M31").End(xlDown).Offset(1, 0).Select
Else
Range("V29") = Year(Range("R33").Value)
End If
End If
If Range("T33") > 0 Then
YearPITI_2 = Range("T32").End(xlDown).Offset(1, -2)
Else
YearPITI_2 = Range("R33")
End If
If Range("M33") > 0 Then
Range("P29") = YearDUE1
Range("Q29") = YearDUE2
Range("T29") = YearPITI_2
End If
Thanks for viewing,
Steve