Network days with exclude holidays (range)

ymeyaw

New Member
Joined
Apr 24, 2006
Messages
29
Dear friends,

i am stucked under this place where i need to refer a list of holiday in different sheet(same workbook), how can i link that with my holiday list?

How should i link my "Holiday" to list of holiday let say in column A at sheet 2?



ElseIf StartDate <> 0 And EndDate <> 0 And RejectedDate = 0 And ResubmittedDate = 0 Then
Cells(a, "W") = Application.WorksheetFunction.NetworkDays(StartDate, EndDate,Holiday)

Thanks a lot.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Do you have a range named Holiday?

Code:
Cells(a, "W") = Application.WorksheetFunction.NetworkDays(StartDate, EndDate,Range("Holiday"))

Note that NetworkDays was not a WorksheetFunction prior to Excel 2007. It was in the Analysis ToolPak Add-In.
 
Upvote 0
Hi Sir,

I keep having subsricption out of range when i have the following range list. Where is my problem :(



HolidayList = ActiveWorkbook.Worksheets(Holiday).Range("A1:A10")
|
|
|


ElseIf StartDate <> 0 And EndDate <> 0 And RejectedDate = 0 And ResubmittedDate = 0 Then
Cells(a, "W") = Application.WorksheetFunction.NetworkDays(StartDate, EndDate, Range("HolidayList"))
 
Upvote 0
You don't reference it like that - you just need:

ElseIf StartDate <> 0 And EndDate <> 0 And RejectedDate = 0 And ResubmittedDate = 0 Then
Cells(a, "W") = Application.WorksheetFunction.NetworkDays(StartDate, EndDate, Worksheets("Holiday").Range("A1:A10"))
 
Upvote 0
First:

Code:
HolidayList = ActiveWorkbook.Worksheets("Holiday").Range("A1:A10").Value

Then:

Code:
Cells(a, "W") = Application.WorksheetFunction.NetworkDays(StartDate, EndDate, HolidayList)
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top