Copy value until next value
For Each CELL In RNG
CURRPERIOD = ActiveCell.Value
If ActiveCell = "" Then
ActiveCell.Value = CURRPERIOD
Else
CURRPERIOD = ActiveCell.Value
End If
Next
This isn't working because you're setting CURRPERIOD to active cell and
then you check active cell try this:
'assuming the first active cell has a value
CURRPERIOD = ActiveCell.Value
range(next cell).select
For each CELL in RNG
If ActiveCell = CURRPER1 then
range(next cell).select
Elseif ActiveCell = "" then
Activecell = CURRPERIOD
range(next cell).select
Else
CURRPERIOD = ActiveCell.Value
range(next cell).select
End If
Next
|