Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to create a function to alternate names in a cell from a list?
Im creating a schedule and want to have a button that alternates names from a
list for the selected cell. |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to create a function to alternate names in a cell from a list?
Here the list of name is in H1 thru H4:
Sub NextName() Dim r1 As Range, r2 As Range Set r1 = ActiveCell Set r2 = Range("H1:H4") If r1.Value = "" Then r1.Value = r2(1).Value Exit Sub End If v = r1.Value For Each rr In r2 If rr.Value = v Then Set r3 = rr.Offset(1, 0) If Intersect(r3, r2) Is Nothing Then Set r3 = r2(1) End If r1.Value = r3.Value End If Next End Sub Change the list to suit your needs. Assign a button (or any piece of clipart) to the macro. -- Gary''s Student - gsnu200841 "Elias" wrote: Im creating a schedule and want to have a button that alternates names from a list for the selected cell. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
create a random list of names from a list of names in EXCEL | Excel Worksheet Functions | |||
How do I create a list of names and addresses? | Excel Discussion (Misc queries) | |||
How do I create/filter a list of names without duplications | Excel Discussion (Misc queries) | |||
alternate UI for Define Names ?? | Excel Discussion (Misc queries) | |||
Create a list in one worksheet of the other worksheets' names | Excel Worksheet Functions |