Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a long column of numbers, but some of them are
blank. Here is what it looks like: (Top of Column) Blank Cell Blank Cell 478 Blank Cell Blank Cell Blank Cell Blank Cell Blank Cell 6009 I want to fill the blank cells with the numbers from the bottom, so it looks like this: (Top of Column) 478 478 478 6009 6009 6009 6009 6009 6009 See my problem? I forsee a simple little macro which starts at the bottom number in the column, copies it, and moves up one cell. If the new cell is blank, it pastes the number and moves up one more cell, etc. When the new cell already has a number, it copies that number and pastes it into the blank cells above it. How do you write this sucker? Thank you for your help. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub tester()
Dim S As String Dim L As Long Dim Col As Long Col = 1 ' A column For L = Cells(65000, Col).End(xlUp).Row To 1 Step -1 If Cells(L, Col).Formula = "" Then Cells(L, Col).Formula = S Else S = Cells(L, Col).Formula End If Next End Sub HTH. Best wishes Harald "Bill Wilson" skrev i melding ... I have a long column of numbers, but some of them are blank. Here is what it looks like: (Top of Column) Blank Cell Blank Cell 478 Blank Cell Blank Cell Blank Cell Blank Cell Blank Cell 6009 I want to fill the blank cells with the numbers from the bottom, so it looks like this: (Top of Column) 478 478 478 6009 6009 6009 6009 6009 6009 See my problem? I forsee a simple little macro which starts at the bottom number in the column, copies it, and moves up one cell. If the new cell is blank, it pastes the number and moves up one more cell, etc. When the new cell already has a number, it copies that number and pastes it into the blank cells above it. How do you write this sucker? Thank you for your help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Maco code doesn't work. Why? | Excel Discussion (Misc queries) | |||
Protect a maco in master copy | Excel Discussion (Misc queries) | |||
Is there any way to have a maco click a command button | Excel Discussion (Misc queries) | |||
A simple maco . . . | New Users to Excel | |||
closing form w/ Maco | Excel Programming |