![]() |
A simple maco for someone, but not for me.
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. |
A simple maco for someone, but not for me.
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. |
All times are GMT +1. The time now is 10:09 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com