Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default 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.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Maco code doesn't work. Why? Joe M. Excel Discussion (Misc queries) 2 January 13th 10 07:13 PM
Protect a maco in master copy [email protected] Excel Discussion (Misc queries) 2 March 30th 07 04:20 PM
Is there any way to have a maco click a command button ChairMan Excel Discussion (Misc queries) 0 March 23rd 06 03:58 PM
A simple maco . . . Steve New Users to Excel 3 January 2nd 05 10:36 PM
closing form w/ Maco jeffP Excel Programming 4 June 19th 04 10:29 PM


All times are GMT +1. The time now is 11:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"