Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
No News
 
Posts: n/a
Default selecting a single sheet from a volume of sheets in a workbook

Hi All,

I have 30 and above sheets in a work book and like that I am having 5 such
books. The sheets are named as 201, 202, 203 ....etc as per the contents in
that particular sheets. (201, 202 .....are the P.O nos.). all the work
sheets are of having similar format of datas.

Now what I need is if I want to look the details of one single sheet (say
324) I have go all the sheets one by one and it is hard to find out.

If any body give me a solution so that if I type a particular no. (forms
part of the name of the sheet) that sheet should appear for me.

Help please.

TT


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Scoops
 
Posts: n/a
Default selecting a single sheet from a volume of sheets in a workbook


No News wrote:

If any body give me a solution so that if I type a particular no. (forms
part of the name of the sheet) that sheet should appear for me.


Hi No News

If your really want to do it this way, add this code to each sheet:

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo nosheet
If Target.Address = "$A$1" Then
Sheets(Range("A1").Value).Activate
End If
Exit Sub

nosheet:
MsgBox ("No sheet with the name " & Range("A1").Value & " found")
End Sub

Amend the $A$1 to the cell you want to use.

Alternatively, you could right-click the navigation arrows at the
bottom left of the screen (next to Sheet1 in a new workbook) and select
your sheet from there.

Regards

Steve

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
No News
 
Posts: n/a
Default selecting a single sheet from a volume of sheets in a workbook

Dear Steeve.

Thanks for your immediate reply.

For your 2nd option. Since I have more than 100 Sheets It is difficult for
me to select

For your 1st option:- Since I was not so familier with excel, I do not know
where to add these codes to each sheet. Can you explain please.

Thanks in advance.


"Scoops" wrote in message
ups.com...

No News wrote:

If any body give me a solution so that if I type a particular no. (forms
part of the name of the sheet) that sheet should appear for me.


Hi No News

If your really want to do it this way, add this code to each sheet:

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo nosheet
If Target.Address = "$A$1" Then
Sheets(Range("A1").Value).Activate
End If
Exit Sub

nosheet:
MsgBox ("No sheet with the name " & Range("A1").Value & " found")
End Sub

Amend the $A$1 to the cell you want to use.

Alternatively, you could right-click the navigation arrows at the
bottom left of the screen (next to Sheet1 in a new workbook) and select
your sheet from there.

Regards

Steve



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Scoops
 
Posts: n/a
Default selecting a single sheet from a volume of sheets in a workbook


No News wrote:
Dear Steeve.

For your 1st option:- Since I was not so familier with excel, I do not
know
where to add these codes to each sheet. Can you explain please.


Hi No News

Pasting the code into 100 sheets would be painful itself, so:

Press Alt+F11 to open the vb editor.

Click Insert Module.

Paste the following code into the window that opens:

Sub SheetFind()
Dim mySheet As String

On Error GoTo nosheet
mySheet = InputBox("Please enter the Sheet name to activate", "GoTo
Sheet")
Sheets(mySheet).Activate
Exit Sub

nosheet:
MsgBox ("No sheet with the name " & mySheet & " found")
End Sub


***End of code***

The Input box isn't very elegant but functional.

To run the macro:

From the Excel toolbar click Tools Macro Macros SheetFind.


You might want to investigate placing a custom button on your toolbar
and assigning the macro to it so that it runs with a single click
(right-click a toolbar and Customize...)

Regards

Steve

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
No News
 
Posts: n/a
Default selecting a single sheet from a volume of sheets in a workbook

Dear Steve,

When running the macro it stops at the following line with error

Dim mySheet As String

Please advise what todo




"Scoops" wrote in message
ups.com...

No News wrote:
Dear Steeve.

For your 1st option:- Since I was not so familier with excel, I do not
know
where to add these codes to each sheet. Can you explain please.


Hi No News

Pasting the code into 100 sheets would be painful itself, so:

Press Alt+F11 to open the vb editor.

Click Insert Module.

Paste the following code into the window that opens:

Sub SheetFind()
Dim mySheet As String

On Error GoTo nosheet
mySheet = InputBox("Please enter the Sheet name to activate", "GoTo
Sheet")
Sheets(mySheet).Activate
Exit Sub

nosheet:
MsgBox ("No sheet with the name " & mySheet & " found")
End Sub


***End of code***

The Input box isn't very elegant but functional.

To run the macro:

From the Excel toolbar click Tools Macro Macros SheetFind.


You might want to investigate placing a custom button on your toolbar
and assigning the macro to it so that it runs with a single click
(right-click a toolbar and Customize...)

Regards

Steve





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Scoops
 
Posts: n/a
Default selecting a single sheet from a volume of sheets in a workbook


No News wrote:
Dear Steve,

When running the macro it stops at the following line with error

Dim mySheet As String

Please advise what todo


Hi No News

The error is in this line (Isuspect that it is in red in your code):

mySheet = InputBox("Please enter the Sheet name to activate",
"GoTo
Sheet")

The problem has come from the formatting of the line in the posting.

Make sure that "GoTo Sheet") is on the same line, not split as in the
original post and remove the " (double quote) that the vba editor will
have added after the last close bracket - it should be "GoTo Sheet")
not "GoTo Sheet ") "

Regards

Steve

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
Selecting Last Sheet Bonbon Excel Worksheet Functions 17 February 22nd 06 04:16 PM
Combining data from cells from several excel sheets to a new sheet Rik Excel Discussion (Misc queries) 4 February 22nd 06 09:16 AM
Multiple sheets as data for a single sheet Newbie1092 Excel Worksheet Functions 1 December 19th 05 05:20 PM
Lookup values in multipul sheets and show value in another sheet Kim Excel Worksheet Functions 3 June 17th 05 01:56 PM
Save a single sheet from a workbook JAMES T. Excel Discussion (Misc queries) 2 January 25th 05 02:16 PM


All times are GMT +1. The time now is 01:55 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"