Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If we have dates in A1 and A2, we can use the NETWORKDAYS
function in Excel to get a net workday count. =NETWORKDAYS(A1,A2) Is there a way to get this result in a macro? TIA. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Set a reference to the Analysis toolpak, APTVBAEN.XLA (lower-case on my
machine) and then just call it, like so ?networkdays(date-100,date-10) -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Ken" wrote in message ... If we have dates in A1 and A2, we can use the NETWORKDAYS function in Excel to get a net workday count. =NETWORKDAYS(A1,A2) Is there a way to get this result in a macro? TIA. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, Bob, but you lost me here.
How/where do we set a reference to the Analysis toolpak? What goes into the macro code? Thanks for your patience. -----Original Message----- Set a reference to the Analysis toolpak, APTVBAEN.XLA (lower-case on my machine) and then just call it, like so ?networkdays(date-100,date-10) -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Ken" wrote in message ... If we have dates in A1 and A2, we can use the NETWORKDAYS function in Excel to get a net workday count. =NETWORKDAYS(A1,A2) Is there a way to get this result in a macro? TIA. . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ken,
In Excel, go to the Tools menu, choose Add-Ins, and the put a check next to "Analysis Tool Pak - VBA". Then, go the VBA editor, choose the Tools menu, then References. There, put a check next to "ATPVBAEN.XLA". -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Ken" wrote in message ... Sorry, Bob, but you lost me here. How/where do we set a reference to the Analysis toolpak? What goes into the macro code? Thanks for your patience. -----Original Message----- Set a reference to the Analysis toolpak, APTVBAEN.XLA (lower-case on my machine) and then just call it, like so ?networkdays(date-100,date-10) -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Ken" wrote in message ... If we have dates in A1 and A2, we can use the NETWORKDAYS function in Excel to get a net workday count. =NETWORKDAYS(A1,A2) Is there a way to get this result in a macro? TIA. . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
So, with dates in A1 and A2 would the code to put the
networkdays in A3 be: Sub Test() Dim count As Integer wks.Cells(3, 1).Value = networkdays(A2, A1) End Sub I am coding it wrong because it doesn't seem to work? -----Original Message----- Ken, In Excel, go to the Tools menu, choose Add-Ins, and the put a check next to "Analysis Tool Pak - VBA". Then, go the VBA editor, choose the Tools menu, then References. There, put a check next to "ATPVBAEN.XLA". -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Ken" wrote in message ... Sorry, Bob, but you lost me here. How/where do we set a reference to the Analysis toolpak? What goes into the macro code? Thanks for your patience. -----Original Message----- Set a reference to the Analysis toolpak, APTVBAEN.XLA (lower-case on my machine) and then just call it, like so ?networkdays(date-100,date-10) -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Ken" wrote in message ... If we have dates in A1 and A2, we can use the NETWORKDAYS function in Excel to get a net workday count. =NETWORKDAYS(A1,A2) Is there a way to get this result in a macro? TIA. . . |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ken,
Use wks.Cells(3, 1).Value = networkdays(Range("A2"),Range("A1")) -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Ken" wrote in message ... So, with dates in A1 and A2 would the code to put the networkdays in A3 be: Sub Test() Dim count As Integer wks.Cells(3, 1).Value = networkdays(A2, A1) End Sub I am coding it wrong because it doesn't seem to work? -----Original Message----- Ken, In Excel, go to the Tools menu, choose Add-Ins, and the put a check next to "Analysis Tool Pak - VBA". Then, go the VBA editor, choose the Tools menu, then References. There, put a check next to "ATPVBAEN.XLA". -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Ken" wrote in message ... Sorry, Bob, but you lost me here. How/where do we set a reference to the Analysis toolpak? What goes into the macro code? Thanks for your patience. -----Original Message----- Set a reference to the Analysis toolpak, APTVBAEN.XLA (lower-case on my machine) and then just call it, like so ?networkdays(date-100,date-10) -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Ken" wrote in message ... If we have dates in A1 and A2, we can use the NETWORKDAYS function in Excel to get a net workday count. =NETWORKDAYS(A1,A2) Is there a way to get this result in a macro? TIA. . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
networkdays function | Excel Worksheet Functions | |||
Networkdays Function | Excel Worksheet Functions | |||
NETWORKDAYS function | Excel Discussion (Misc queries) | |||
Nesting Networkdays function inside and If function | Excel Worksheet Functions | |||
Nested IF Function, Date Comparing, and NetworkDays Function | Excel Worksheet Functions |