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!

Formating an undefined range in Excel from Access

Status
Not open for further replies.

Wongy

MIS
Dec 2, 2003
10
0
0
NZ
Hi all I have some code that inserts search results from an access database into an Excel worksheet.

I want to put borders around the cells in excel. I know how to put borders around a defined range but the number of rows populated in the excel sheet will vary depending on the number of search results.

Basically I need some code that will do Range("B6:??).Select

I managed to record this Macro in Excel but I can't get it to work
Range("B6").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select

thanks in advance for anyone who can help me






 
And what about this ?
Range("B6").CurrentRegion.Select

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Thanks. fiendishly simple but highly effective
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top