Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel date lookup using several worksheets

I am writing a macro in workbook_open
what I am wanting to do is search through my workbook for todays date
in a certain range.
then activate that workbook.

I currently have this code

Private Sub Workbook_Open()

Dim dates As Range
Dim cell As Range
Dim ws As Worksheet
Worksheets(Day(1)).Activate

For Each ws In Worksheets
On Error Resume Next
Worksheets(ws.Name).Activate
Set dates = Range("b3")
Set cell = dates.Find(Date)
If Not cell Is Nothing Then
cell.Activate
Exit For
End If

Next ws

End Sub

But it keeps giveing me the wrong sheet. It selects the last sheet in
the workbook.
Any help would greatly be appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Excel date lookup using several worksheets

I am looking in cell b3 on each sheet looking for the date.
For some reason it will not find the date specified. I also went into
the cell and made sure that it was reading the date right and it was.
Thanks

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
Function to lookup date on tab in excel and populate date on calen MGC Excel Worksheet Functions 0 February 4th 10 04:48 AM
Lookup date on multiple worksheets, total amts for adjacent colmn robnsd Excel Discussion (Misc queries) 0 February 15th 07 11:32 PM
Do Ms Excel able to lookup more than 1 date in spreadsheet? weitak_83 Excel Worksheet Functions 3 August 31st 06 12:27 AM
EXCEL LOOKUP FISCAL YEAR WITH DATE Toni's Taxi Excel Worksheet Functions 2 February 5th 06 01:22 PM
how to use lookup a value by date for criteria in Excel sheet dom Excel Worksheet Functions 5 January 11th 05 04:22 AM


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