Hello,
Been trying to figure this out for a few days now, and starting to drive me crazy.
I am starting to believe I would need to utilize an array to achieve the results needed. I am trying to tell VBA that if the cells in range 2 are not equal to twelve, then have the corresponding cells in range1 divide by itself, and multiply by 12.
The code I have above is completely off, just tried to simplify the code for easier understanding of what I am trying to achieve, as well as the methodology and syntax I am trying to use.
If somebody could advise further, that would be extremely appreciated.
Been trying to figure this out for a few days now, and starting to drive me crazy.
VBA Code:
Sub Annualize()
Dim WB As Workbook
Set WB = ThisWorkbook
Dim WS As Worksheet
Set WS = WB.ThisWorksheet
Dim Range1 As Range
Set Range1 = WS.Range("B2:B4")
Dim Range2 As Range
Set Range2 = WS.Range("C2:C4")
For Each C In Range1
If Range2.Address <> 12 Then
For Each D In Range2()
Range1.Cells = (Range1.Address / Range1.Address) * 12
Next D
End If
Next C
End Sub
I am starting to believe I would need to utilize an array to achieve the results needed. I am trying to tell VBA that if the cells in range 2 are not equal to twelve, then have the corresponding cells in range1 divide by itself, and multiply by 12.
The code I have above is completely off, just tried to simplify the code for easier understanding of what I am trying to achieve, as well as the methodology and syntax I am trying to use.
If somebody could advise further, that would be extremely appreciated.