Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Autofill to the last empty cell in a range

I have a list that looks like this:

10010 11221 102.00
102.00
102.00
10011 11247 103.50
103.50
103.50


The list goes on for thousands of rows. The columns are A, B and C.
I am trying unsucessfully to create a macro to autofill the first two
columns until the numbers change. In other words, 10010 would stop at
the last empty cell above 10011. It would repeat this all down the
page.

I am currently trying to count up from the bottom of the page...but I
don't know the code to loop the formula.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Autofill to the last empty cell in a range

Sub fillcolumns()

RowCount = 1
StartRow = RowCount
Do While Range("C" & RowCount) < ""
If Range("A" & (RowCount + 1)) < "" Or _
Range("C" & (RowCount + 1)) = "" Then

Range("A" & StartRow & ":B" & StartRow).Copy _
Destination:=Range("A" & StartRow & ":B" & RowCount)

StartRow = RowCount + 1
End If

RowCount = RowCount + 1
Loop
End Sub


"Jim" wrote:

I have a list that looks like this:

10010 11221 102.00
102.00
102.00
10011 11247 103.50
103.50
103.50


The list goes on for thousands of rows. The columns are A, B and C.
I am trying unsucessfully to create a macro to autofill the first two
columns until the numbers change. In other words, 10010 would stop at
the last empty cell above 10011. It would repeat this all down the
page.

I am currently trying to count up from the bottom of the page...but I
don't know the code to loop the formula.

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Autofill to the last empty cell in a range


See John Walkenbach's clever, non vba, method...
http://spreadsheetpage.com/index.php...ies_in_a_list/
--
Jim Cone
Portland, Oregon USA



"Jim"
wrote in message
I have a list that looks like this:

10010 11221 102.00
102.00
102.00
10011 11247 103.50
103.50
103.50

The list goes on for thousands of rows. The columns are A, B and C.
I am trying unsucessfully to create a macro to autofill the first two
columns until the numbers change. In other words, 10010 would stop at
the last empty cell above 10011. It would repeat this all down the
page.
I am currently trying to count up from the bottom of the page...but I
don't know the code to loop the formula.
Thanks
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
autofill empty cells with a macro in excel WolfgangPD Excel Programming 6 October 2nd 07 03:30 PM
'Autofill' macro for range of checkbox cell links [email protected] Excel Discussion (Misc queries) 1 December 5th 06 02:44 PM
Finding next empty empty cell in a range of columns UncleBun Excel Programming 1 January 13th 06 11:22 PM
AutoFill of empty cells Tom Ogilvy Excel Programming 2 December 27th 04 08:51 PM
AutoFill of empty cells Marc Excel Programming 0 September 22nd 04 02:15 PM


All times are GMT +1. The time now is 03:21 PM.

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

About Us

"It's about Microsoft Excel"