Rotating List question excel

MrFuzzyBootzz

New Member
Joined
Apr 2, 2024
Messages
4
Im looking to make a rotating list of 9 names where the top name will go to the bottom of the list and the rest move up 1. Now I also need it where if the name is not available I click a button or selecet "No" and that name wont move on the list but the other names will. Is this possible?
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
try this on a copy of you file.

this code assumes for list of name starts in cell A1,the list of name can be as long as you like.

VBA Code:
Sub Move_up()
n = Cells(Rows.Count, "A").End(xlUp).Row 'set last row with a name

Cells(n + 1, "A") = [A1] 'move fist name to the bottom

For r = 1 To n 'loop to mover every name up 1 row
    Cells(r, "A") = Cells(r + 1, "A")
Next r

Cells(n + 1, "A").ClearContents ' clear the last name on the list

End Sub

how would like to distinguish the names that do not move up the list?

hth,

Ross
 
Upvote 0
I currently have a list selection for yes and No in the b column so if I have No seleceted it would be nice if that name wont move
 
Upvote 0
An idea of what the sheet looks like would help. If there's data in the row below the 9th name, that code will over-write it, yes? If that is the case I think I'd use a collection and add an empty string where the name should not move.
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
try this

names start in cell A1, List of names can be as long as you want.
if corrospoining column B has No then that name will not be shifted up.

Enjoy
-Ross

VBA Code:
Sub Move_up()

x = Cells(Rows.Count, "A").End(xlUp).Row 'set last row with a name

'always move the first on to the end
Cells(x + 1, "A") = [A1]
[A1].ClearContents


r = 1
n = 1

888
If Cells(r + n, "B") = "No" Then
     n = n + 1
     GoTo 888
End If
     
Cells(r, "A") = Cells(r + n, "A")
Cells(r + n, "A").ClearContents
    
r = r + n: n = 1
If r > x Then Exit Sub 'no more names
GoTo 888

End Sub
 
Upvote 0
Ive ran into an issue with your code. I have my list of names but if the first slot is selected as No the names erase when I click the buttom
 
Upvote 0

Forum statistics

Threads
1,215,326
Messages
6,124,263
Members
449,149
Latest member
mwdbActuary

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top