Damckinleysr
New Member
- Joined
- Jan 6, 2015
- Messages
- 3
I have a row with the Year and Month in each cell in the format 201401 (YYYYMM).
201401 is in A1 The progression is 201401 201402 201403 ..... 201512.
If I named the Range "YYYYMM" (=Sheet1!$A$1:$X$1) Excel will automatically put in the proper value- if I put =YYYYMM in B1 it will display 201401. If I fill right for 23 cells each cell will have =YYYYMM and Excel will put in the proper value for that column. For example: K2 will display as 201411.
I have a function that counts the number of Friday's in the month
Fuction (YYYYMM as String) as Integer
if put = GetFridaysinMonth (K1) in K2 it clearly passes 201411 as the string and returns 4.
To make the worksheet more readable I want to use the name range YYYYMM as an argument. If I put = GetFridaysinMonth (YYYYMM) in K2 how can I make the function know the value of YYYYMM is 201411?
Fuction GetFridaysinMonth (YYYYMM as range) as Integer
How do I figure out it is in col K and value is 201411? If have tried byVal, etc and cannot figure out right combination. Any clues?
End Function
Thanks
201401 is in A1 The progression is 201401 201402 201403 ..... 201512.
If I named the Range "YYYYMM" (=Sheet1!$A$1:$X$1) Excel will automatically put in the proper value- if I put =YYYYMM in B1 it will display 201401. If I fill right for 23 cells each cell will have =YYYYMM and Excel will put in the proper value for that column. For example: K2 will display as 201411.
I have a function that counts the number of Friday's in the month
Fuction (YYYYMM as String) as Integer
if put = GetFridaysinMonth (K1) in K2 it clearly passes 201411 as the string and returns 4.
To make the worksheet more readable I want to use the name range YYYYMM as an argument. If I put = GetFridaysinMonth (YYYYMM) in K2 how can I make the function know the value of YYYYMM is 201411?
Fuction GetFridaysinMonth (YYYYMM as range) as Integer
How do I figure out it is in col K and value is 201411? If have tried byVal, etc and cannot figure out right combination. Any clues?
End Function
Thanks