Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-14-2016, 07:21 AM
chriss17 chriss17 is offline Get next non empty cell from a specific list with VBA Windows 10 Get next non empty cell from a specific list with VBA Office 2016
Novice
Get next non empty cell from a specific list with VBA
 
Join Date: Jun 2016
Posts: 1
chriss17 is on a distinguished road
Exclamation 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
Reply With Quote
  #2  
Old 06-14-2016, 07:50 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Get next non empty cell from a specific list with VBA Windows 7 64bit Get next non empty cell from a specific list with VBA Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,779
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

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
Reply With Quote
  #3  
Old 06-15-2016, 08:40 AM
KunleExcel KunleExcel is offline Get next non empty cell from a specific list with VBA Windows 8 Get next non empty cell from a specific list with VBA Office 2010 32bit
Novice
 
Join Date: Jun 2016
Location: Nigeria
Posts: 17
KunleExcel is on a distinguished road
Default

Sub SelectLastName()

Dim ListRange As Range

Set ListRange = Range("A1:A7")

Range("B1") = ListRange.End(xlDown).Value

ListRange.End(xlUp).Select
End Sub
Reply With Quote
Reply



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
Get next non empty cell from a specific list with VBA 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
Get next non empty cell from a specific list with VBA 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

Other Forums: Access Forums

All times are GMT -7. The time now is 01:33 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft