Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Selecting Last Sheet | Excel Worksheet Functions | |||
Combining data from cells from several excel sheets to a new sheet | Excel Discussion (Misc queries) | |||
Multiple sheets as data for a single sheet | Excel Worksheet Functions | |||
Lookup values in multipul sheets and show value in another sheet | Excel Worksheet Functions | |||
Save a single sheet from a workbook | Excel Discussion (Misc queries) |