#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 251
Default Need a macro

I'm working with a huge spreadsheet of over 20,000 rows. I need a macro that
will copy the number in a cell down to the first cell with another number.
In other words, cell A35 has, for example, 4500245842 in it. A42 has
450245989 in it. Then A85 has 450246910 in it. The macro needs to complete
A36-A41 with 4500245842, A43-A84 with 450245989, and so on down the 20,000+
rows. Is this possible? Connie
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Need a macro

Sub copy_down()
Dim r As Range, rr As Range, n As Long
With ActiveSheet.UsedRange
n = .Rows.Count + .Row - 1
End With

Set r = Range(Cells(1, "A"), Cells(n, "A")).SpecialCells(xlCellTypeBlanks)

For Each rr In r
rr.FillDown
Next
End Sub

--
Gary''s Student - gsnu200786
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 251
Default Need a macro

Dear Gary"s student,
You are amazing! Thank you so very much. Do you know how much work you
saved me? I can't begin to tell you. Thank you! Connie

"Gary''s Student" wrote:

Sub copy_down()
Dim r As Range, rr As Range, n As Long
With ActiveSheet.UsedRange
n = .Rows.Count + .Row - 1
End With

Set r = Range(Cells(1, "A"), Cells(n, "A")).SpecialCells(xlCellTypeBlanks)

For Each rr In r
rr.FillDown
Next
End Sub

--
Gary''s Student - gsnu200786

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 846
Default Need a macro


No need for a macro

Highlight the area that you want to fill in blanks including the first
non-blank cell.

press F5 (goto)

Click the button called special

Click blanks hit okay

if the first blank cell enter =(cell above)

and then hold the control key down while hitting enter

this will fill in the blanks......
--
Wag more, bark less


"Connie Martin" wrote:

I'm working with a huge spreadsheet of over 20,000 rows. I need a macro that
will copy the number in a cell down to the first cell with another number.
In other words, cell A35 has, for example, 4500245842 in it. A42 has
450245989 in it. Then A85 has 450246910 in it. The macro needs to complete
A36-A41 with 4500245842, A43-A84 with 450245989, and so on down the 20,000+
rows. Is this possible? Connie

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 251
Default Need a macro

Brad, I will try this sometime when I have a smaller worksheet. With over
20,000 rows, the macro works much more quickly. I have printed yours to keep
for future reference. Thank you. Connie

"Brad" wrote:


No need for a macro

Highlight the area that you want to fill in blanks including the first
non-blank cell.

press F5 (goto)

Click the button called special

Click blanks hit okay

if the first blank cell enter =(cell above)

and then hold the control key down while hitting enter

this will fill in the blanks......
--
Wag more, bark less


"Connie Martin" wrote:

I'm working with a huge spreadsheet of over 20,000 rows. I need a macro that
will copy the number in a cell down to the first cell with another number.
In other words, cell A35 has, for example, 4500245842 in it. A42 has
450245989 in it. Then A85 has 450246910 in it. The macro needs to complete
A36-A41 with 4500245842, A43-A84 with 450245989, and so on down the 20,000+
rows. Is this possible? Connie



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 251
Default Need a macro

Brad, I just tried yours in another column. It works like a charm, too!
Thank you so much. This is simple and great to know. Thanks! Connie

"Brad" wrote:


No need for a macro

Highlight the area that you want to fill in blanks including the first
non-blank cell.

press F5 (goto)

Click the button called special

Click blanks hit okay

if the first blank cell enter =(cell above)

and then hold the control key down while hitting enter

this will fill in the blanks......
--
Wag more, bark less


"Connie Martin" wrote:

I'm working with a huge spreadsheet of over 20,000 rows. I need a macro that
will copy the number in a cell down to the first cell with another number.
In other words, cell A35 has, for example, 4500245842 in it. A42 has
450245989 in it. Then A85 has 450246910 in it. The macro needs to complete
A36-A41 with 4500245842, A43-A84 with 450245989, and so on down the 20,000+
rows. Is this possible? Connie

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
need help to update macro to office 2007 macro enabled workbook jatman Excel Discussion (Misc queries) 1 December 14th 07 01:57 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 03:04 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"