|
-
Apr 9th, 2009, 08:06 AM
#1
Thread Starter
Member
VB-Excel: Detect end of extract and print
I am working on some VB script (within Excel) it connects to DB and pulls back information.
What i need to do it auto-detect the end of the date and seclect it all so that i can run the 'Selection.PrintOut' cmd. Dose anyone know how to detect the end of the data?
let me explain the data will always be between "A#:J#". The rows could change accoring to the number of records pulled back from the DB.
Else dose anyone know a better way (aka not using Selection.PrintOut)?
Thanks for the help guys
Alien
-
Apr 9th, 2009, 08:22 AM
#2
Re: VB-Excel: Detect end of extract and print
 Originally Posted by alien260
I am working on some VB script (within Excel) it connects to DB and pulls back information.
How does it do that?
-
Apr 9th, 2009, 08:56 AM
#3
Thread Starter
Member
Re: VB-Excel: Detect end of extract and print
It uses a ADODB.Connection runs some SQL and then prints it to a couple of worksheets.
-
Apr 9th, 2009, 07:03 PM
#4
Re: VB-Excel: Detect end of extract and print
maybe you could use the recordcount of the recordset
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Apr 10th, 2009, 07:05 AM
#5
Re: VB-Excel: Detect end of extract and print
Sheet1.UsedRange.PrintOut
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|