Hi,
Let's assume that you want to fill up from cell A4500 to cell A1, here is the macro to do it.
Sub Fillup()
Range(Cells(4500, 1), Cells(1, 1)).FillUp
End Sub
Hope this helps. If you have any questions please feel free to ask.
this unfortunately doesn't work b/c every 10 rows (it varies) there's different text - I want it to fill the spaces in between with the text below. Hence the fill up - this filled everything up with what was at the bottom.
You said the Fill Down worked but you couldn't do it with the Fill Up, so it was assumed that whatever your were doing with the Fill Down can be similarly done with the Fill Up.
Anyway, so you want to fill only the blank rows in the range? If so can you tell me exactly the range (first cell and last cell including column numbers) and which cell has the data to be copied to the empty cells.
Thanks.
I don't need to know the specific rows that have values, only the concept. Are you trying to fill up the empty cells using the data from the first non empty cell that comes after each block of empty rows?
One other thing, since you are able to do it with Fill Down, the logical and simplest way to do this is if you can post the method or code that you are using for the Fill Down and I will modify it for you to Fill Up.
I can do the fill down with excel/goto/special/blanks/....
but that won't work upwards
or
Sub CopyDown()Const StartRowNo = 1Const EndRowNo = 2000Const ColumnNo = 2Dim curText As String, curRowNo As Long
curRowNo = StartRowNoDo While IsEmpty(Cells(curRowNo, ColumnNo)) And curRowNo <= EndRowNocurRowNo = curRowNo + 1Loop
Do While curRowNo <= EndRowNoIf IsEmpty(Cells(curRowNo, ColumnNo).Value) ThenCells(curRowNo, ColumnNo).Value = curTextElsecurText = Cells(curRowNo, ColumnNo).ValueEnd IfcurRowNo = curRowNo + 1LoopEnd Sub
I see.
Ok here is a much simpler way to fill up the blank cells (using the value of the cell that follows the blanks).
FILE
Check it and let me know if it needs any modification.
it looks as though this should have been only column "p" was affected however, every column did the fillup?
Yes, that is because you specified column P when you gave me the range "P7:p4686".
Now which columns do you want to include in the fill up operation?
Ok, I see where the problem is. My bad
Please change the 1 in this line :
Range(Cells(i, "P"), Cells(i - k, 1)).Select
to "P" , so it will become like this:
Range(Cells(i, "P"), Cells(i - k, "P")).Select
Let me know.
BS Degree in Engineering
20 years experience in Excel programming and various major applications.
You need to replace the word "Select" in that line by "FillUp". You see the Select is used only for testing to see where the fillup will be applied.