Solved

autofill range to last row in column for specific worksheets

Posted on 2014-02-03
2
360 Views
Last Modified: 2014-02-03
Hello,

I have a number of active worksheets in Wb"A". I would like the macro to run for specific worksheets named, Sheet1, Sheet4, Sheet8.

In each named sheet, the macro should fill down the columns D-H to the last row in Column A, starting at the last row in Columns D-H.

e.g. if the last row in column A is 200 and the last row in Columns D-H is 150, then the macro should fill down D150-H200.

The macro should then repeat for all the named sheets in the workbook.

Thanks,
CC
0
Comment
Question by:CC10
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 52

Accepted Solution

by:
Rgonzo1971 earned 400 total points
ID: 39829425
Hi,

pls try

Sub Macro()
aShts = Array("Sheet1", "Sheet4")
For Each sht In aShts
Sheets(sht).Activate
LastRowA = Range("A" & Cells.Rows.Count).End(xlUp).Row
LastRowD = Range("D" & Cells.Rows.Count).End(xlUp).Row
Range("D" & LastRowD & ":H" & LastRowA).FillDown
Next
End Sub 

Open in new window

Regards
0
 

Author Closing Comment

by:CC10
ID: 39829679
Perfect. Thanks vm.
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question