vba code...... on update...........

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a pivot table, and on selection i want it to format the width of the
columns. The problem i'm having is that i can only set the widths to all the
same. Im wanting column A & B wider than the rest. The code i have used so
far is >>>>>

Range("C:Z").Select
Selection.ColumnWidth = 14
Range("A:B").Select
Selection.ColumnWidth = 31

but this some how sets all the coloumns to 31????????

Any help will be helpful as i am new to vba, thanks

Paul
 
ALL SORTED........... I had a merged cell in there which was causing some
problems,

thanks
 
I think we need to see abit more of your code. The snippet you provided does
work for me.
 
Glad to hear you got it sorted. However, for future reference, it is
good coding practice not to make a selection if you don't have to.
You can change the column width by just using the Range object.
Range("C:Z").ColumnWidth = 14
Range("A:B").ColumnWidth = 31
 

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

Back
Top