LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Ant
 
Posts: n/a
Default

Thanks Dave - that works a treat. Good man!

"Dave Peterson" wrote:

You may want to check to make sure that the worksheet actually exists, too:

Option Explicit
Sub testme()

Dim testWks As Worksheet

Set testWks = Nothing
On Error Resume Next
Set testWks = Sheets(ActiveSheet.Range("H10").Value)
On Error GoTo 0

If testWks Is Nothing Then
MsgBox "Doesn't exist!"
Else
With testWks
.Visible = xlSheetVisible
.Select
End With
End If

End Sub






Ant wrote:

Bob,

I tried that code and it works perfectly. however it only works if the
worksheet it is looking for is not hidden. Do you know what the additional
code is to unhide and select the Sheet name in eg cell "H10".

"Bob Phillips" wrote:

Is the drop-down data validation? If so, it is just the cell the DV is in

Sheets(Range("H10").Value).Select

as an example

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ant" wrote in message
...
Probably a bit of an easy one...I have a selection of hidden worksheets
which
appear in a drop down box and linked to a cell with a vlookup. I than have
a
macro button which, once clicked, opens a worksheet. I want to add some
code
that opens up the result of the vlookup determined by the dropdown box.
For
example, if I select Sheet5 from the drop down box which in turn becomes
the
sheet name in the vlookup cell, when I click the Macro button, Sheet5
opens.
Currently I have Sheets("Sheet1").Select in the macro which obviously will
only open Sheet1. I have done this before but I can't remember the code.




--

Dave Peterson

 
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
Can the =CELL formula be used to determine the worksheet tab name. Hawk186 Excel Worksheet Functions 4 August 18th 05 05:40 PM
Search/Match between 2 x separate Worksheets and populate result in third worksheet Alan Bartley Excel Discussion (Misc queries) 1 April 11th 05 05:21 AM
Make Change Case in Excel a format rather than formula Kevin Excel Worksheet Functions 1 March 18th 05 08:53 PM
Weekly Transaction Processing Ralph Howarth Excel Worksheet Functions 4 January 19th 05 05:37 AM
Worksheet Event Code chequer - ExcelForums.com Excel Worksheet Functions 0 November 10th 04 06:30 AM


All times are GMT +1. The time now is 03:59 PM.

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"