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

Excel Automation from Access: Trying to reference CurrentRegion

Status
Not open for further replies.

Quehay

Programmer
Feb 6, 2000
804
US
Before I give up and look for a job as a parking lot attendant, can anyone help out with this:

I import a rst to Excel just fine. What I want to do next is select the new area of cells that have been filled in order to apply formatting. I can't figure out how to get a Range reference to the region. Within Excel, the recorder gives Macro language:

Range("Z200").select
selection.currentregion.select

this isn't working in the OLE mode, neither is (the # of rows/columns is provided by rst counts):

With objxlwkb.ActiveSheet
.Range(.Cells(1, 1), .Cells(10, 10)).select
End With

I can get a reference to the last cell with "xlspecialcellslast" but can't get that address into the next selection.

(The code examples are paraphrased)

This should be simple but it's stymied me. . .any takers?
 
Sorry for the alarm--found it:

[tt]objxlwksht.Range("a1").CurrentRegion.Select
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top