G
Guest
Good afternoon,
I have a few functions I have created that I would like to use to build a macro expression. Any help would be appreciated!
Public Function Quarteryear()
Quarteryear = InputBox("Enter the quarter and year you'd like reported (QQ-YYYY):")
End Function
Public Function Quarter()
Quarter = Mid$(Quarteryear, 2, 1)
End Function
Public Function Year()
Year = Right$(Quarteryear, 2)
End Function
First, are any of these reserved for VBA? If not, I can change them - not a problem. Finally, I have queries with names (bad names, I know!) of:
4Q-03 Labor Standards Updates
3Q-04 Labor Standards Updates
Obviously, my Quarteryear() InputBox should pull in format 03-2003. So, I want to use the Quarter and Year functions (to simplify the expression from mid$ and right$) to call the correct query. Here's what I have as my query expression:
=Quarter() & "Q-" & Year() & " Labor Standards Updates"
Yes, there is a space before Labor...
Thanks for the help in advance!
Derek
I have a few functions I have created that I would like to use to build a macro expression. Any help would be appreciated!
Public Function Quarteryear()
Quarteryear = InputBox("Enter the quarter and year you'd like reported (QQ-YYYY):")
End Function
Public Function Quarter()
Quarter = Mid$(Quarteryear, 2, 1)
End Function
Public Function Year()
Year = Right$(Quarteryear, 2)
End Function
First, are any of these reserved for VBA? If not, I can change them - not a problem. Finally, I have queries with names (bad names, I know!) of:
4Q-03 Labor Standards Updates
3Q-04 Labor Standards Updates
Obviously, my Quarteryear() InputBox should pull in format 03-2003. So, I want to use the Quarter and Year functions (to simplify the expression from mid$ and right$) to call the correct query. Here's what I have as my query expression:
=Quarter() & "Q-" & Year() & " Labor Standards Updates"
Yes, there is a space before Labor...
Thanks for the help in advance!
Derek