Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Quick question about moving around a worksheet using vba in a macr
What vba snipet can I use to select the next empty cell in column A (at the
bottom of my data) without referencing a specific cell? For example I need to be able to go to the bottom of the data, but the amount of data may vary so I need to be able to select the next empty cell in a column without referencing a specific cell because the bottom of the data won't be the same cell every time. I've tried to just record a macro and press ctrl shift down or something like that, but in the recorded macro it just references the cell at the bottom of the data that the shortcut went to, not "the bottom of the data that may vary based on what data I start with" I apprecite all help!!! Oh and I can't use addins because it will be a part of a much larger macro so I'm hoping to have a code that doesn't have any manual work to it at all. So much thanks!!!! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Quick question about moving around a worksheet using vba in a macr
To return the next empty cell starting at A2 looking down the column:
Dim c As Range Set c = Range("A2").End(xlDown).Offset(1) c.Select The above will find a gap in the data if it exists. If you potentially have gaps in your data and don't want to stop there but want the next empty cell below the last cell in column A containing data: Dim c As Range Set c = Cells(Rows.Count, 1).End(xlUp).Offset(1) c.Select Regards, Greg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Quick VBA Worksheet Change Event or Selection Question: | Excel Worksheet Functions | |||
Quick question | Excel Programming | |||
Copy data from one worksheet to another using a function or a macr | Excel Worksheet Functions | |||
Quick question - quick answer about assigning shortcut keys | Excel Programming | |||
Quick question | Excel Programming |