[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Excel VBA to filldown filled range by n rows

Posted on 2011-05-03
2
Medium Priority
?
332 Views
Last Modified: 2012-05-11
How do I have to amend the code below to fill down the last non-empty row by n (DailyRowsToInsert) rows?
TargetWsDaily.Activate
LastRow = Range("A" & Rows.Count).End(xlUp).Row
LastColumn = Cells(LastRow, Columns.Count).End(xlToLeft).Column

TargetWsDaily.Range("A" & LastRow & ":" & LastColumn & LastRow).FillDown

ActiveCell.Resize(LastRow, LastColumn).Copy Range(Cells(LastRow + DailyRowsToInsert, 1), Cells(LastRow, LastColumn))

Open in new window

0
Comment
Question by:stmoritz
2 Comments
 
LVL 39

Accepted Solution

by:
nutsch earned 200 total points
ID: 35516777
Try

TargetWsDaily.Cells(LastRow, 1).Resize(DailyRowsToInsert, LastColumn).FillDown

Open in new window



Thomas
0
 

Author Closing Comment

by:stmoritz
ID: 35516832
perfect. thanks a lot.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

834 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