Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default Macro needed (like find)

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 12
Default Macro needed (like find)

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
FIND and REPLACE characters needed Peter C New Users to Excel 2 February 10th 06 07:09 PM
FIND and REPLACE characters needed Peter C Excel Worksheet Functions 0 February 8th 06 09:14 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 05:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"