Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I make macro use the date in a certain cell?

Status
Not open for further replies.
Mar 5, 2002
292
US
I have a spreadsheet that opens with 2 prompts to enter dates, start and ending. I have 7 sheets that I want to use that date for when I click on a macro.

How do I tell the macro to use those two dates in those cells rather than haveing @DATE(2002,3,1) in the query?

I have 5 queries that I need to run for each sheet then total some of the data.

I wonder if a pivot table would be better for this? I need to be able to specify dates though for the person running it.

Any suggestions? Thanks in advance! :O)

[trooper][vader][wedge][r2d2][bobafett][anakin]
 
You need to save the dates as global varibles that way you should be able to call them from any of the routines you design
 
Ninash,

Hmm, OK. The people running it will need to be able to insert any date they wish. I'm not sure I understand you correctly.
 
Hey Visual,

When ninash said Global Variable, it means to define a variable as public for the project. Then, whatever values you assign to those variables, are in storage for any other procedure to use.

Alternatively, you could make a sheet for global variables and stick the values in that sheet using Named Ranges.

Hope this helps :) Skip,
metzgsk@voughtaircraft.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top