Round Robin Triggered by Button Click

jorgegarcia27

New Member
Joined
Nov 16, 2015
Messages
4
What I need: a cell that populates the next name from a list whenever a macro button is clicked. When the list is exhausted, it should restart with the first name. I'm essentially looking to route leads evenly by creating a Google Sheet that provides the lead router with the next name on the list. The reason it needs to be done by click is the sheet will be shared with multiple lead routers.

I used this video to show me how to create a round robin in Excel. I want to hide the round robin in a hidden tab and simply create a button that when clicked, will bring up the next name on the list. The round robin is triggered by I5 (the start number). I can't seem to figure out how to get a click to add 1 to that number with each click and then go back to 1 after I reach 5 as a start number.

Here's the file.

Does this make sense?
 

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 Example:-
Data in column "A", result (each Click) in "B1"
Code:
[COLOR="Navy"]Sub[/COLOR] MG16Nov06
[COLOR="Navy"]Dim[/COLOR] Rng [COLOR="Navy"]As[/COLOR] Range
Static n
[COLOR="Navy"]Set[/COLOR] Rng = Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))
    n = n + 1
    n = IIf(n = Rng.Count + 1, 1, n)
    Range("B1") = Rng(n)
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0
Try this Example:-
Data in column "A", result (each Click) in "B1"
Code:
[COLOR=Navy]Sub[/COLOR] MG16Nov06
[COLOR=Navy]Dim[/COLOR] Rng [COLOR=Navy]As[/COLOR] Range
Static n
[COLOR=Navy]Set[/COLOR] Rng = Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))
    n = n + 1
    n = IIf(n = Rng.Count + 1, 1, n)
    Range("B1") = Rng(n)
[COLOR=Navy]End[/COLOR] [COLOR=Navy]Sub[/COLOR]
Regards Mick

That didn't work. When I created a button and assigned that macro, it simply copied cell A1 into B1.
 
Upvote 0
I'm relatively new to this so I wasn't aware the VBA wouldn't work in the Google Sheets script editor. Is there an easy way to translate the code?
 
Upvote 0

Forum statistics

Threads
1,216,743
Messages
6,132,464
Members
449,729
Latest member
davelevnt

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