LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
Rob Rob is offline
external usenet poster
 
Posts: 718
Default Finding Worksheet and Activating it

How would I go about searching for a specific worksheet and activating it
upon opening a workbook?

The worksheet should be named as Todays month and date, like this... 1-30.

This is what I have started...

Private Sub Workbook_Open()
Dim yDay, tDay, yMth, tMth
Dim dFri, dMon, dNow

yDay = Day(Date) - 1
tDay = Day(Date)
yMth = Month(Date) - 1
tMth = Month(Date)
dFri = 6
dMon = 2
dNow = Weekday(Date)


If Sheets(tMth & "-" & tDay).Name = True Then

Sheets(tMth & "-" & tDay).Activate
Exit Sub

Else
MsgBox "Please create a sheet for today", vbOKOnly

End If

End Sub

Any help would be awesome.

Thanks in advance,
Rob
 
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
How to auto populate an invoice from data in an existing worksheet juliebythesea Excel Discussion (Misc queries) 5 October 28th 09 08:14 AM
Activating a Worksheet? Kenny R Excel Discussion (Misc queries) 3 December 8th 06 05:15 PM
Activating a worksheet through use of a variable Cads Excel Worksheet Functions 2 February 7th 06 10:45 AM
Macro or OLE method to insert worksheet from template workbook Lyndon Rickards Excel Discussion (Misc queries) 0 January 30th 06 08:46 PM
Activating "Todays Date" column upon opening? Jeremy H via OfficeKB.com Excel Discussion (Misc queries) 3 August 25th 05 02:36 AM


All times are GMT +1. The time now is 07:50 AM.

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"