View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John Bundy John Bundy is offline
external usenet poster
 
Posts: 125
Default Repeating Above Value

try this:

Private Sub CommandButton1_Click()
Dim myRow As Integer
Dim myValue As String
myRow = 1
Do Until myRow = Cells(Rows.Count, "A").End(xlUp).Row
If Cells(myRow, 1) < "" Then myValue = Cells(myRow, 1)
If Cells(myRow, 1) = "" Then Cells(myRow, 1) = myValue
myRow = myRow + 1

Loop
End Sub

change the rows.count,"A" part to match the column that contains the last
row of data and set myrow= to what row to start on.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Roger J Michaud" wrote:

I create reports in Cognos Impromtu that I save in Excel. I must group
certain columns in order to get information displayed properly. How do I
ungroup columns in excel. In other words, I have a number then a quantity of
blank spaces below then another number and a different quantity of blank
spaces below. I would like the excel program to repeat the above value until
it hits a value below it and then repeat that value until it hits another
value below it.

Is this possible?? Copy Paste is driving me insane. My reports can be 10-20
thousand lines long.