Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Jeremy H via OfficeKB.com
 
Posts: n/a
Default Activating "Todays Date" column upon opening?

Ok I have a workbook that tracks Vacation Dates, Attendence, and Schedules
for all employees in a department.
Row 8 Starting from column B (B8) and beyond (B9, B10, B11, B12...) contains
the date. This runs all the way to the end of the year (12/31/05)

Now what I would like to do is either A:
Make it automatically (search & activate) the column for "today's" date when
I select the worksheet

Or B:
Make a button that will do the same.

Here is a rough guestimate of what the sheet looks like



A B C D E F


8/01 8/02 8/02 8/04 8/04...........
Absent
Days
Days

Absent
Nights
Nights

Absent
Overnights
Overnights

Now on each row in the date columns, I have "Data, Validation, List,
day_shift" or "night_shift" etc so if an employee calls in sick on 8/02 I go
to a "Dayshift" slot, then scroll across to the current date, then select
that agents name from the list.

This is on a worksheet called "Attendence"

Ideally when I click on attendence, the column for today's days, will be the
visible or active column instead of having to scroll across.

Alternatively a button would work that I just press and it scrolls across to
todays date column

I know I can use "=DATE()" to determine the current date anytime the book is
opened, know how do I process that variable into selecting the appropriate
column?
  #2   Report Post  
Rowan
 
Posts: n/a
Default

You could use the worksheet activate event:

Private Sub Worksheet_Activate()
Dim tday As Range
Dim eCol As Integer
eCol = Cells(8, Columns.Count).End(xlToLeft).Column
With Range(Cells(8, 2), Cells(8, eCol))
Set tday = .Find(what:=Date)
If Not tday Is Nothing Then
tday.Select
End If
End With
End Sub

This is worksheet event code. Right click the sheet tab, select view code
and paste the code in there.

Hope this helps
Rowan

"Jeremy H via OfficeKB.com" wrote:

Ok I have a workbook that tracks Vacation Dates, Attendence, and Schedules
for all employees in a department.
Row 8 Starting from column B (B8) and beyond (B9, B10, B11, B12...) contains
the date. This runs all the way to the end of the year (12/31/05)

Now what I would like to do is either A:
Make it automatically (search & activate) the column for "today's" date when
I select the worksheet

Or B:
Make a button that will do the same.

Here is a rough guestimate of what the sheet looks like



A B C D E F


8/01 8/02 8/02 8/04 8/04...........
Absent
Days
Days

Absent
Nights
Nights

Absent
Overnights
Overnights

Now on each row in the date columns, I have "Data, Validation, List,
day_shift" or "night_shift" etc so if an employee calls in sick on 8/02 I go
to a "Dayshift" slot, then scroll across to the current date, then select
that agents name from the list.

This is on a worksheet called "Attendence"

Ideally when I click on attendence, the column for today's days, will be the
visible or active column instead of having to scroll across.

Alternatively a button would work that I just press and it scrolls across to
todays date column

I know I can use "=DATE()" to determine the current date anytime the book is
opened, know how do I process that variable into selecting the appropriate
column?

  #3   Report Post  
Jeremy H via OfficeKB.com
 
Posts: n/a
Default

Thank you very much!

Works like a charm!

Rowan wrote:
You could use the worksheet activate event:

Private Sub Worksheet_Activate()
Dim tday As Range
Dim eCol As Integer
eCol = Cells(8, Columns.Count).End(xlToLeft).Column
With Range(Cells(8, 2), Cells(8, eCol))
Set tday = .Find(what:=Date)
If Not tday Is Nothing Then
tday.Select
End If
End With
End Sub

This is worksheet event code. Right click the sheet tab, select view code
and paste the code in there.

Hope this helps
Rowan

Ok I have a workbook that tracks Vacation Dates, Attendence, and Schedules
for all employees in a department.

[quoted text clipped - 41 lines]
opened, know how do I process that variable into selecting the appropriate
column?

  #4   Report Post  
Rowan
 
Posts: n/a
Default

You're welcome.

"Jeremy H via OfficeKB.com" wrote:

Thank you very much!

Works like a charm!

Rowan wrote:
You could use the worksheet activate event:

Private Sub Worksheet_Activate()
Dim tday As Range
Dim eCol As Integer
eCol = Cells(8, Columns.Count).End(xlToLeft).Column
With Range(Cells(8, 2), Cells(8, eCol))
Set tday = .Find(what:=Date)
If Not tday Is Nothing Then
tday.Select
End If
End With
End Sub

This is worksheet event code. Right click the sheet tab, select view code
and paste the code in there.

Hope this helps
Rowan

Ok I have a workbook that tracks Vacation Dates, Attendence, and Schedules
for all employees in a department.

[quoted text clipped - 41 lines]
opened, know how do I process that variable into selecting the appropriate
column?


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
How do I create a schedule from a list of dates ? Gavin Morris Charts and Charting in Excel 2 October 28th 10 04:08 PM
match and count words David Excel Worksheet Functions 5 July 4th 05 02:24 AM
Comparing Cells and Displaying Data Keith Brown Excel Worksheet Functions 1 February 9th 05 05:42 PM
Despite formatting a column in Excel 2002 worksheet as Short Date. Pete Whalley Excel Discussion (Misc queries) 2 February 7th 05 06:17 PM
Date in descending order to come up automatically in a column? Snugglebums Excel Worksheet Functions 2 January 11th 05 03:09 PM


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