Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 709
Default worksheet funtion help

I understand that this goes in the vb code but I don't understand on how to
make it work. All my formulas for my holidays are in the form of Worksheet
Formulas on Sheet3, Column A. How would I add this formula to say Sheet3,
cell A26.
Public Function ThanksgivingDate(Yr As Integer) As Date
ThanksgivingDate = DateSerial(Yr, 11, 29 - _
WeekDay(DateSerial(Yr, 11, 1), vbFriday))
End Function
Thanks in advance!!!

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default worksheet funtion help

in A26:

=ThanksgivingDate(2006)

or

=ThanksgivingDate(X1) where x1=2006

Format A26 as Date.

HTH

"Richard" wrote:

I understand that this goes in the vb code but I don't understand on how to
make it work. All my formulas for my holidays are in the form of Worksheet
Formulas on Sheet3, Column A. How would I add this formula to say Sheet3,
cell A26.
Public Function ThanksgivingDate(Yr As Integer) As Date
ThanksgivingDate = DateSerial(Yr, 11, 29 - _
WeekDay(DateSerial(Yr, 11, 1), vbFriday))
End Function
Thanks in advance!!!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default worksheet funtion help

You simply type

=ThanksGivingDate(year)

in the cell.

All it does is return the date of ThanksGivingDay for the nominated year.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Richard" wrote in message
...
I understand that this goes in the vb code but I don't understand on how

to
make it work. All my formulas for my holidays are in the form of

Worksheet
Formulas on Sheet3, Column A. How would I add this formula to say Sheet3,
cell A26.
Public Function ThanksgivingDate(Yr As Integer) As Date
ThanksgivingDate = DateSerial(Yr, 11, 29 - _
WeekDay(DateSerial(Yr, 11, 1), vbFriday))
End Function
Thanks in advance!!!



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
Search one worksheet for values in another worksheet? ClayShooters Excel Discussion (Misc queries) 1 July 4th 06 03:01 PM
Worksheet not showing up in VBE Kevin Vaughn Excel Worksheet Functions 3 June 12th 06 03:22 PM
Search/Match between 2 x separate Worksheets and populate result in third worksheet Alan Bartley Excel Discussion (Misc queries) 1 April 11th 05 05:21 AM
Copy from worksheet to another x times Union70 Excel Discussion (Misc queries) 0 March 7th 05 09:03 PM
Weekly Transaction Processing Ralph Howarth Excel Worksheet Functions 4 January 19th 05 05:37 AM


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