chadwe
07-16-2009, 09:35 AM
I need to use an absolute row reference and a relative column reference in my VBA code.
I go to specified rows within a worksheet and perform the following IF statement in 12 cells in the row (performs IF statement, goes to one cell to the right until 12th cell to right) then the active cell becomes a cell in the next row.
Now ActiveCell.Offset(-8, 0) in my IF statement is pointing the wrong row. I want my code to always point to the same row. Any help with this would be appreciated.
If InServiceDate < ActiveCell.Offset(-8, 0) Then
ActiveCell = AssetAmount / DepreciationMonths
Else ActiveCell = 0
End If
I go to specified rows within a worksheet and perform the following IF statement in 12 cells in the row (performs IF statement, goes to one cell to the right until 12th cell to right) then the active cell becomes a cell in the next row.
Now ActiveCell.Offset(-8, 0) in my IF statement is pointing the wrong row. I want my code to always point to the same row. Any help with this would be appreciated.
If InServiceDate < ActiveCell.Offset(-8, 0) Then
ActiveCell = AssetAmount / DepreciationMonths
Else ActiveCell = 0
End If