Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 31st, 2007, 02:54 PM
Registered User
 
Join Date: Jul 2007
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Updating Microsoft Query

I am using MS office 2000. I use query to import a list of client names and their individual contract numbers from an a billable report which is in a separate excel spreadsheet.
EX:

15 ABC
30 Group
12 Joe Smith Co.

I then take this info and put it into a chart. My problem is that each new week, I create a new billable report worksheet. Currently my query data is coming from 071407 but now I want it to come from 072807 and so on and so forth. How can I change this? (And if so, automatically would be great). Thanks!

Reply With Quote
  #2 (permalink)  
Old August 1st, 2007, 01:01 AM
Friend of Wrox
Points: 3,060, Level: 23
Points: 3,060, Level: 23 Points: 3,060, Level: 23 Points: 3,060, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2005
Location: , , .
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Here is the way

Assuming you have spreadsheet corresponding to the date

Sub Dynamic_Query()

Dim sTabName As String
Dim sXS As String
Dim sQuery As String

sXS = CStr(Format(Date, "mmddyy"))
sTabName = "[" & sXS & "$]"
sQuery = "Select * From " & sTabName & ";" '

End Sub
")

http://www.dotnetdud.blogspot.com
Reply With Quote
  #3 (permalink)  
Old August 1st, 2007, 09:16 AM
Registered User
 
Join Date: Jul 2007
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm sorry I don't think I was clear, I meant in a different workbook, not spreadsheet. Will this still work??

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert SQL to Microsoft Query tgates Excel VBA 0 April 18th, 2008 01:49 PM
Problem updating query sinner Classic ASP Databases 0 January 29th, 2006 02:51 PM
Microsoft Query and Oracle stored procedure shl007 SQL Language 0 October 21st, 2003 02:43 PM
Microsoft Query and Oracle danielwajnberg SQL Language 4 September 17th, 2003 10:55 AM
Microsoft Query and Oracle danielwajnberg Oracle 0 August 28th, 2003 01:49 PM



All times are GMT -4. The time now is 05:31 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.