Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a drop down list of names, and I need the macro to find the name
selected within the workbook. The names that are found would be on individual sheets. Could this be created? Thank you. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Where are the dropdown lists of names found? Let's say it's in cells B1:B10
Sub test() Dim myRange As Range Dim r As Range Dim myWS As Worksheet Set myRange = ActiveSheet.Range("B1:B10") For Each r In myRange If Len(r.Value) 0 Then Set myWS = Nothing On Error Resume Next Set myWS = ActiveWorkbook.Worksheets(r.Value) '<~~may want to check this syntax On Error GoTo 0 If myWS Is Nothing Then Set myWS = Worksheets.Add(after:=ActiveWorkbook.Sheets(Active Workbook.Worksheets.Count)) myWS.Name = r.Value End If End If Next r End Sub HTH, Barb Reinhardt "doral" wrote: I have a drop down list of names, and I need the macro to find the name selected within the workbook. The names that are found would be on individual sheets. Could this be created? Thank you. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This didn't work. What I want to do say. I have a list a through d on first
sheet. Then I have 4 other sheets with a on one, b on one, etc to d. I want to select from a drop down list a letter, say d, then have a textbox with a macro assigned to it which would then find that letter in the other 4 sheets (a through d). So after you would run the macro, it would go to sheet d. "Barb Reinhardt" wrote: Where are the dropdown lists of names found? Let's say it's in cells B1:B10 Sub test() Dim myRange As Range Dim r As Range Dim myWS As Worksheet Set myRange = ActiveSheet.Range("B1:B10") For Each r In myRange If Len(r.Value) 0 Then Set myWS = Nothing On Error Resume Next Set myWS = ActiveWorkbook.Worksheets(r.Value) '<~~may want to check this syntax On Error GoTo 0 If myWS Is Nothing Then Set myWS = Worksheets.Add(after:=ActiveWorkbook.Sheets(Active Workbook.Worksheets.Count)) myWS.Name = r.Value End If End If Next r End Sub HTH, Barb Reinhardt "doral" wrote: I have a drop down list of names, and I need the macro to find the name selected within the workbook. The names that are found would be on individual sheets. Could this be created? Thank you. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
FIND and REPLACE characters needed | New Users to Excel | |||
FIND and REPLACE characters needed | Excel Worksheet Functions | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) |