View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Glen[_5_] Glen[_5_] is offline
external usenet poster
 
Posts: 31
Default 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