[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

how to I write a Macro in Excel to go to the first available row before copy and pasting

Posted on 2011-10-17
2
Medium Priority
?
301 Views
Last Modified: 2013-11-05
The title says it all..looking at a quick and easy code to make my cursor go to the first avilable row so that each time I copy and paste it will be below the previous copy and paste. thanks
0
Comment
Question by:vtahal17
2 Comments
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 36981210
range("A" & rows.count).end(xlup).offset(1,0)

will point to the first blank row in column A below the last used row in column A
0
 
LVL 12

Accepted Solution

by:
kgerb earned 2000 total points
ID: 36981520
This will give you the last row and the last data entry can be in any column.
lrow = Cells.Find("*", , xlValues, xlWhole, xlByColumns, xlPrevious).Offset(1).Row

Open in new window


Kyle
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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.
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

829 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