Solved

autofill range to last row in column for specific worksheets

Posted on 2014-02-03
2
359 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 51

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

734 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