silentwolf
Well-known Member
- Joined
- May 14, 2008
- Messages
- 1,216
- Office Version
- 2016
Hi again,
sorry guys to be a pain about this issue.
whti this code above I am able to find holidays in either germany or in austria in a periode of time within my worksheet.
However as I need this dates for different calculations i.E. on some of the projects we need to work and others not so on holidays there must be a different hourly rate
So what other functions I could use to to that instead of giving my back the date?
Hope I explained myself good well enough.
Many thanks
sorry guys to be a pain about this issue.
Code:
Sub myLookUp()
Dim lngLR As Long
Dim i As Long
Dim rngHoli As Range
Dim intDoppelt As Integer
lngLR = Cells(Rows.Count, 2).End(xlUp).row
If Range("B2").value = "Germany" Then
Set rngHoli = Application.Names("Holidays_Germany").RefersToRange.Rows
Else
Set rngHoli = Application.Names("Holidays_Austria").RefersToRange.Rows
End If
For i = 5 To lngLR
Cells(i, 4) = WorksheetFunction.IfError(Application.VLookup(Cells(i, 2), rngHoli, 1, False), "")
Next i
End Sub
whti this code above I am able to find holidays in either germany or in austria in a periode of time within my worksheet.
However as I need this dates for different calculations i.E. on some of the projects we need to work and others not so on holidays there must be a different hourly rate
So what other functions I could use to to that instead of giving my back the date?
Hope I explained myself good well enough.
Many thanks