LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 373
Default Noob Question 2

To do this on all the worksheets when the workbook is opened, copy this code
and paste in the Workbook Module. On my machine (Excel XP), you can find
this module by showing one of the spreadsheets, right-click on the Excel
icon on the very left side of the menubar, and select View Code. Paste the
code in there. When you open the workbook the next time, it will run on all
sheets. Hope this helps, James

Private Sub Workbook_Open()
Dim MyItem As Double, ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Activate
If IsEmpty(Range("D3").Value) Then
MyItem = Month(Now) / 12 * Range("G4").Value
Else
MyItem = Month(Range("D3").Value) / 12 * Range("G4").Value
End If
Range("G1").Value = MyItem
Next ws
End Sub

"O...." wrote in message
...
Vacation Accrued, Sorry I'm half retarded

"O...." wrote:

I have a workbook called Vacation Accurred within that workbook I have
Wooksheets for John Doe, Jane Doe, Joe Smith, Suzzie Jones, etc I Want to
execute that code when the Wookbook is open for all Worksheets (John Doe,
Jane Doe, Suzzie Jones and So On.....

thanks...

"Zone" wrote:

Sorry, I don't know what you mean by "Multiply worksheets".

"O...." wrote in message
...
Thanks Zone, How do I Execute it for Multiply worksheets when the
work
book
is open

"O...." wrote:

Thanks Guys.... One more question. Should I use a nested If or can I
use
Else. If there's a date In (Range("D3").Value) I Want to take the
Month
of
"D3" / 12 * Range("G4").Value). Thanks

O......




I'm Getting Object Required. Run Time Error '424' . Trying to
evaluate
a
cell and If it's Null do the calculation MyItem = (Month(Now()) /
12 *
G4.Value) and place it cell G1 and if it's NOT Null use the Value
in D3
Cell
which is a date and Replace the Now Function in my Calculation.
Thanks
for
the Help in Advance. O....

Sub MyEvaluate()
Dim MyItem As Long
If IsEmpty(Range("D3").Value) Then
MyItem = (Month(Now()) / 12 * G4.Value)
G1.Value = MyItem
End If
End Sub






 
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
Noob Question O.... Excel Programming 7 October 2nd 07 11:24 PM
Noob Question Probably! :S LHUK Excel Programming 1 August 4th 07 02:14 AM
Noob question letmeplay1977 Excel Worksheet Functions 2 October 5th 05 09:27 PM
Noob question Micro_pal New Users to Excel 2 September 4th 05 02:37 PM
Noob question Micro_pal Excel Discussion (Misc queries) 5 September 3rd 05 01:42 AM


All times are GMT +1. The time now is 07:15 AM.

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"