LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,388
Default Autofill to Last Row but Miss Some Rows?

Hi Guys,

I'm trying to write in to a macro the ability to Autofill a column from a
cell (H7) to LastRow as you can see below, but miss out rows that have no
value in Column D.

E.g.

If

LastRow is 20
D7 has value? Yes. Fill Row.
D8 has value? Yes. Fill Row.
D9 has value? No. Skip Row.
D10 has value? Yes. Fill Row.........

Code:

Dim lastRow As Long
lastRow = Range("A65536").End(xlUp).row
Range("H7:H7").Select
Selection.AutoFill Destination:=Range("H2:H" & lastRow)
Can anyone help with this?

Thanks
Dave
 
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 counting up Columns and Rows! fantomet Excel Worksheet Functions 5 December 14th 06 12:57 PM
Macros or the Fastest way to Autofill Rows klafert Excel Discussion (Misc queries) 1 September 30th 06 09:04 PM
Need help wiht a macro for autofill rows klafert Excel Worksheet Functions 9 September 10th 06 07:47 PM
AutoFill down X number of rows. Paul987 Excel Discussion (Misc queries) 2 April 24th 06 06:36 PM
AutoFill over 30,000 rows Cathy Excel Worksheet Functions 4 January 31st 06 10:22 PM


All times are GMT +1. The time now is 11:12 AM.

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"