Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
entering current time in shared work book - 2003 | Excel Discussion (Misc queries) | |||
Excel 2003 - open work book useage agreement | Excel Worksheet Functions | |||
work book open _ event | Excel Worksheet Functions | |||
App_change event to open all work book | Excel Discussion (Misc queries) | |||
I was messing arround with the VBA and now I get the macro warning when I open the work book but when... | New Users to Excel |