VBA - Autofill To Last Row of Data

aeddipa

Active Member
Joined
Jun 1, 2009
Messages
337
I'm trying to write a macro that allows me to autofill columns D:G starting always starting at D7 and going until there is no more data found in columns A:C in any subsequent rows. So, in this example the last piece of data is row 578, but next time it may be 800. How do I write the autofill so that it continue until no matter data is left?

Thanks!

Code:
Range("D6").Select
    Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
    Range("D7:G7").Select
    Application.CutCopyMode = False
    [B]Selection.autofill Destination:=Range("D7:G578")
[/B]    Columns("F:G").EntireColumn.AutoFit
    Columns("D:D").EntireColumn.AutoFit
 
Cool AlphaFrog - Sorry I didn't see your code line, only saw OP's reference to Col B...
 
Upvote 0

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Appreciate the breakdown. Definitely helped out. I knew most of the lines of code, but not too familiar with the asterisk wildcard.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,751
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top