ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pasting on next empty cell (https://www.excelbanter.com/excel-programming/295256-pasting-next-empty-cell.html)

Byron[_2_]

Pasting on next empty cell
 
How do I tell my macro to look for the next empty cell before pasting


TH[_3_]

Pasting on next empty cell
 
Byron,

Use the End Property. Here's the description from HELP:

Returns a Range object that represents the cell at the end of the region
that contains the source range. Equivalent to pressing END+UP ARROW,
END+DOWN ARROW, END+LEFT ARROW, or END+RIGHT ARROW. Read-only.

Syntax
expression.End(Direction)
expression Required. An expression that returns a Range object.
Direction Required Long. The direction in which to move. Can be one of the
following XlDirection constants: xlToLeft, xlToRight, xlUp, or xlDown.
-------------
So, you can get to the last EMPTY cell in the current column by doing:
Cells(ActiveCell.End(xlDown).Row + 1, ActiveCell.Column).Paste
-------------
On 4/15/04 17:21, in article
, "Byron"
wrote:

How do I tell my macro to look for the next empty cell before pasting.





All times are GMT +1. The time now is 01:53 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com