autofit function in excel

S

solo_razor

hello,

I have a terrible anoying little problem. My macro generates multiple
workbooks of data extracted from one sheet. Now the sheet where i
placed the buttons gets autofitted, even though i assigned the
workbooks as windows("wb1.xls").activate and than
activesheet.cells.select
selection.autofit

I always autofits my macro sheet(as i like to call it)

Any suggestions?

Regards,
Niek
 
B

BrianB

Try some thing more specific eg. :-
Workbooks("wb1.xls").Worksheets("Sheet1").Columns("A:E").AutoFit

although Activesheet.Columns("A:E").AutoFit should work too
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top