Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using VBA in Excel to locate a sheet

I want to set up a code to read the contents of a cell and locate the
sheet that matches what's in the cell. For example, if the cell reads
"Home", I want it to locate and open the worksheet named Home. How do
I do this?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Using VBA in Excel to locate a sheet

Sub foo()
Dim MySheet As String
On Error GoTo errhandler
MySheet = Range("A1").Value
Worksheets(MySheet).Activate
Exit Sub
errhandler:
MsgBox "There is no worksheet by this name"
End Sub

" wrote in
message oups.com:

I want to set up a code to read the contents of a cell and locate the
sheet that matches what's in the cell. For example, if the cell reads
"Home", I want it to locate and open the worksheet named Home. How do
I do this?


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
LOCATE DATA IN ONE SHEET AND APPLY ATTACHED DATA TO ANOTHER Bruno Excel Discussion (Misc queries) 1 October 16th 06 12:59 PM
Locate month and year from range of date from another sheet Rao Ratan Singh New Users to Excel 3 March 1st 06 07:55 AM
locate excel template Doug McKean Setting up and Configuration of Excel 1 September 29th 05 11:57 AM
Locate all occurrances of a value then transfer to 2nd table on another sheet JimP Excel Programming 2 July 29th 04 03:35 AM
Locate all occurrances of a value then transfer to 2nd table on another sheet JimP Excel Programming 0 July 28th 04 12:01 AM


All times are GMT +1. The time now is 03:56 AM.

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

About Us

"It's about Microsoft Excel"