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

Module that exports to Excel: Formatting question 2

Status
Not open for further replies.

MyaCCt

MIS
May 14, 2014
21
US
Hello all,

I have a module that exports a query to Excel. It's a very nice little thing (thanks, in no small part, to the help I've gotten here). Anyway, I'd like to have a layer of formatting so that the first column is filtered (the little arrows show up without the user having to click on the top cell and click Formatting/Filter). How and where would I put that? I tried xlApp.Selection.AutoFilter and that's not it. Or maybe it is and I'm putting it in at the wrong step.

Thanks!
-Mya
 
Wouldnt it figure... I posted and kept trying different things/different locations, and I've gotten it. Sorry!

xlApp.Range("A1", "I1").AutoFilter

 
You may also try:
[tt]
xlApp.Cells.AutoFilter[/tt]

This will work no matter how many columns you have.

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
I'd prefer
Code:
xlApp.ActiveSheet.UsedRange.AutoFilter

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top