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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting Ranges In Excel

Status
Not open for further replies.

HaydenMB

IS-IT--Management
May 30, 2003
24
GB
Hi,

I have some code written that creates an excel application, formats the page and copies in a recordset from my db which works fine. But now I want to add additional recordset at the bottom of the spreadsheet but I do not know how to do the xlDown function in Access VBA.

As the recorsets I am pasting into the spreadsheet do not have a set number of records I want to go to 3 rows below the previously pasted recordset.

Thanks for the help.

Regards,
Hayden
 
If ws is an Excel worksheet object and rng is an Excel range object then

Set rng = ws.Range("A65536").End(xlUp).Offset(3, 0)

will set the range object to the cell in column A that is 3 rows below the last used cell in column A.
 
Thanks Cheerio,

that worked great

Hayden
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top