Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Finding a sheet

1 view
Skip to first unread message

Linda

unread,
Oct 6, 2003, 11:20:03 AM10/6/03
to
Since you were so quick and helpful about my index question......... If I
happen to know the name of the sheet is there a way to type the first few
letters of the name and then find the sheet that way?

Thanks
Linda


Lady Layla

unread,
Oct 6, 2003, 12:25:31 PM10/6/03
to
Find sheet in a file?

Put your cursor down in the tab area -- all way to left and right click

Select sheet

"Linda" <Romula...@StarfleetHeadquarters.xp> wrote in message
news:%23C3cN1B...@TK2MSFTNGP11.phx.gbl...
: Since you were so quick and helpful about my index question......... If I

:
:


Linda

unread,
Oct 6, 2003, 1:46:12 PM10/6/03
to
Thanks...I was wondering if there were a way to find it by knowing the name.
We have about 50 sheets so there are 2 lists to sort through. I guess I'm
getting really lazy now, huh?

Linda

"Lady Layla" <Ladyla...@yahoo.com> wrote in message
news:O8gkVZCj...@TK2MSFTNGP11.phx.gbl...

Otto Moehrbach

unread,
Oct 6, 2003, 5:32:38 PM10/6/03
to
Linda
You can roll your own macro to do that. There are a number of ways to
do what you want by writing a macro to do it. One way would be for you to
have a cell into which you would type in, say, the first 4 characters and
hit Enter and your sheet pops up. The first question that comes to mind is
how are you going to find the sheet that has that cell? Well, you would
have to attach the macro to every sheet and use the same cell in every sheet
for this task. Post back if you want to explore this further. HTH Otto

"Linda" <Romula...@StarfleetHeadquarters.xp> wrote in message
news:%235O13GD...@tk2msftngp13.phx.gbl...

Linda

unread,
Oct 6, 2003, 7:02:09 PM10/6/03
to
If you can explain it step by step and I can get one step at a time done, I
am game. I'm not in a big rush either so if you are busy at certain times I
don't mind waiting for the next step. I have no programming experience. If
you change your mind, that's ok too. It looks like E1 is blank on all
sheets.

Thanks,
Linda


"Otto Moehrbach" <ottom...@att.net> wrote in message
news:#DbJkFFj...@tk2msftngp13.phx.gbl...

Dave Peterson

unread,
Oct 6, 2003, 7:35:01 PM10/6/03
to
How about a floating toolbar that displays all the worksheet names?

The default behavior when you type into the combobox on that toolbar is to match
the entries.

Option Explicit
Sub auto_close()
On Error Resume Next
Application.CommandBars("MyNavigator").Delete
On Error GoTo 0
End Sub

Sub auto_open()

Dim cb As CommandBar
Dim ctrl As CommandBarControl
Dim wks As Worksheet

On Error Resume Next
Application.CommandBars("MyNavigator").Delete
On Error GoTo 0

Set cb = Application.CommandBars.Add(Name:="myNavigator", temporary:=True)
With cb
.Visible = True
Set ctrl = .Controls.Add(Type:=msoControlButton, temporary:=True)
With ctrl
.Style = msoButtonCaption
.Caption = "Refresh Worksheet List"
.OnAction = ThisWorkbook.Name & "!refreshthesheets"
End With

Set ctrl = .Controls.Add(Type:=msoControlComboBox, temporary:=True)
With ctrl
.AddItem "Click Refresh First"
.OnAction = ThisWorkbook.Name & "!changethesheet"
.Tag = "__wksnames__"
End With
End With

End Sub
Sub ChangeTheSheet()

Dim myWksName As String
Dim wks As Worksheet

With Application.CommandBars.ActionControl
If .ListIndex = 0 Then
MsgBox "Please select an existing sheet"
Exit Sub
Else
myWksName = .List(.ListIndex)
End If
End With

Set wks = Nothing
On Error Resume Next
Set wks = Worksheets(myWksName)
On Error GoTo 0

If wks Is Nothing Then
Call refreshthesheets
MsgBox "Please try again"
Else
wks.Select
End If

End Sub
Sub refreshthesheets()
Dim ctrl As CommandBarControl
Dim wks As Worksheet

Set ctrl = Application.CommandBars("myNavigator") _
.FindControl(Tag:="__wksnames__")
ctrl.Clear

For Each wks In ActiveWorkbook.Worksheets
ctrl.AddItem wks.Name
Next wks
End Sub

(If you swap workbooks, just click the other button to get a fresh list of
worksheet names in the dropdown.)

--

Dave Peterson
ec3...@msn.com

Linda

unread,
Oct 6, 2003, 7:50:14 PM10/6/03
to
Yikes, Dave. That looks like something for the advanced user. I'm going to
paste this in a cell and see what happens.

Linda

"Dave Peterson" <ec3...@msn.com> wrote in message
news:3F81FC25...@msn.com...

Dave Peterson

unread,
Oct 6, 2003, 8:00:47 PM10/6/03
to
It's a macro that you (as the developer) can create. Once you create it, it's
there whenever you open the workbook (well, and enable macros).

Try it on a test workbook with some nicely named worksheets.

When you're in excel,
hit alt-F11 (to get to the VBE)
then hit ctrl-R to see the project explorer (like windows explorer)
rightclick on your workbook/project (VBAProject (book1.xls))
select Insert, then Module

then paste that whole conglomeration in.

then back to excel and hit alt-F8 and doubleclick on Auto_open.
(auto_open will run when ever you open the workbook--so this time it's just for
testing)

Try it out.

It might be overkill, but once you set it up, you're done.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

--

Dave Peterson
ec3...@msn.com

Linda

unread,
Oct 6, 2003, 8:08:00 PM10/6/03
to
That was fun. I opened up a new excel sheet. It just pasted the text like
it is......Nothing happened. I found the tools/macro and made a new macro.
There was nothing in the dialog box so I typed Dave in the Name box. I
selected "create", then the VB window (or Macro Window) opened up. I pasted
your code in there. Now when I open up the macro window there are 5 items
listed. auto_close, auto_open, ChangeTheSheet, Dave, and refreshthesheets.

It says Macros in "This Workbook"

I don't see a floating tool bar though.

Linda


"Linda" <Romula...@IBMThinkPad.UFP> wrote in message
news:#FO2XSGj...@TK2MSFTNGP09.phx.gbl...

Dave Peterson

unread,
Oct 6, 2003, 8:14:41 PM10/6/03
to
Hit alt-F8 (to see that dialog again), then double click on auto_open.

(Or close your workbook (save it, too). then reopen. xl will run the auto_open
macro whenever you open the workbook. and the auto_open code actually builds
the toolbar.)

--

Dave Peterson
ec3...@msn.com

Linda

unread,
Oct 6, 2003, 9:55:55 PM10/6/03
to
Hey, that's very cool!

Thanks,

Linda
"Dave Peterson" <ec3...@msn.com> wrote in message

news:3F820571...@msn.com...

Dave Peterson

unread,
Oct 6, 2003, 10:34:56 PM10/6/03
to
Woohoo!

Linda wrote:
>
> Hey, that's very cool!
>
> Thanks,
>
> Linda

--

Dave Peterson
ec3...@msn.com

0 new messages