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
Re: VB-Excel: Detect end of extract and print
Quote:
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?
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.
Re: VB-Excel: Detect end of extract and print
maybe you could use the recordcount of the recordset
Re: VB-Excel: Detect end of extract and print
Sheet1.UsedRange.PrintOut