Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default open work book to current date

I have Excel 200 in the office and have created a projector booking form. I
want to improve the worksheet by getting it to open at the current date.

The worksheet (column a) has listed in it the date. Can anyone help with
some vb (or other method - I am not fussy) to open the sheet at the current
system date.

Thanks in advance
m


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default open work book to current date


M, you can do it this way:

Dim T As Long
T = Now()
r = Application.Match(T, Columns(1), True)
Application.Goto Cells(r, 1)


assuming that you are on the sheet containing the dates and they are in
column A.

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel



"Smeesh" wrote in message
...
I have Excel 200 in the office and have created a projector booking form.

I
want to improve the worksheet by getting it to open at the current date.

The worksheet (column a) has listed in it the date. Can anyone help with
some vb (or other method - I am not fussy) to open the sheet at the

current
system date.

Thanks in advance
m




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default open work book to current date

Easy!

the formuals are
=Today()
of for a little more info
=now(),

these can be called from vba in the usally way

Enjoy
Ross
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default open work book to current date

Hi Ross (and anybody else who wants to help!),

Thanks for the reply, however I had tried the Today() subfunction and could
not get it to work.

The VBA I have is:
Private Sub Workbook_Open()
Sheets("bookingsheet").Activate
Range((B4:B1454)=Today()).Select
End Sub

I get a compile error because of the :. Am I on the wrong track?

"ross" wrote in message
om...
Easy!

the formuals are
=Today()
of for a little more info
=now(),

these can be called from vba in the usally way

Enjoy
Ross



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default open work book to current date

Try date()
Now() gives you information about the date and time
Date() gives you just date information.


"Smeesh" wrote in message
...
Hi Ross (and anybody else who wants to help!),

Thanks for the reply, however I had tried the Today() subfunction and

could
not get it to work.

The VBA I have is:
Private Sub Workbook_Open()
Sheets("bookingsheet").Activate
Range((B4:B1454)=Today()).Select
End Sub

I get a compile error because of the :. Am I on the wrong track?

"ross" wrote in message
om...
Easy!

the formuals are
=Today()
of for a little more info
=now(),

these can be called from vba in the usally way

Enjoy
Ross







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 303
Default open work book to current date

Bob Flanigans answer was very close.
had to add the Dim r as long line and used the "date" rather then "today"
Tried it out putting the macro in the "this workbook" section.
It works! Thanks for the question I'll be using this myself.
Regards
Bill K

Private Sub Workbook_Open()
Dim r As Long
Dim T As Long
T = Date
r = Application.Match(T, Columns(1), True)
Application.Goto Cells(r, 1)
End Sub


"Suzette" wrote in message
...
Try date()
Now() gives you information about the date and time
Date() gives you just date information.


"Smeesh" wrote in message
...
Hi Ross (and anybody else who wants to help!),

Thanks for the reply, however I had tried the Today() subfunction and

could
not get it to work.

The VBA I have is:
Private Sub Workbook_Open()
Sheets("bookingsheet").Activate
Range((B4:B1454)=Today()).Select
End Sub

I get a compile error because of the :. Am I on the wrong track?

"ross" wrote in message
om...
Easy!

the formuals are
=Today()
of for a little more info
=now(),

these can be called from vba in the usally way

Enjoy
Ross







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
entering current time in shared work book - 2003 Radhakant Panigrahi Excel Discussion (Misc queries) 1 April 21st 10 07:32 PM
Excel 2003 - open work book useage agreement mbotfield Excel Worksheet Functions 3 September 23rd 09 04:53 PM
work book open _ event Hassan Excel Worksheet Functions 1 July 3rd 08 12:49 PM
App_change event to open all work book [email protected] Excel Discussion (Misc queries) 1 August 2nd 07 03:52 PM
I was messing arround with the VBA and now I get the macro warning when I open the work book but when... Marc New Users to Excel 2 June 6th 05 08:08 AM


All times are GMT +1. The time now is 09:11 PM.

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"