Macro needed (like find)
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.
|