#1
|
|||
|
|||
Get next non empty cell from a specific list with VBA
I want to create a vba or a command button rule that either highlights a cell from a selected range or shows the selected cell in a different cell.
More specifically, i have 7 names in cells A1:A7. I want everytime I run the code, to get the next available name on the list (either highlighted or shown in a different cell). When the selection reaches A7 which is the last cell, then i want it to go back to cell A1 and start all over again. What code can i use? And is it better on a vba or on a command button? Thank you |
#2
|
||||
|
||||
Moved to VBA forum
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#3
|
|||
|
|||
Sub SelectLastName()
Dim ListRange As Range Set ListRange = Range("A1:A7") Range("B1") = ListRange.End(xlDown).Value ListRange.End(xlUp).Select End Sub |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Data validation,force cell to be filed with number if respective cell is not empty | nicholes | Excel Programming | 0 | 08-01-2015 09:08 AM |
If id cell range is empty then should not allow to fill any other cell | ubns | Excel Programming | 2 | 04-12-2015 06:31 AM |
Delete empty cell and shift up | Linh | Word Tables | 1 | 09-21-2014 01:52 PM |
Auto add a list cell if the last list cell is filled | tasuooooo | Excel | 1 | 07-31-2012 08:40 PM |