Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
vba code...... on update...........
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
vba code...... on update...........
ALL SORTED........... I had a merged cell in there which was causing some
problems, thanks "CRANSWICK, P" wrote: 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
vba code...... on update...........
I think we need to see abit more of your code. The snippet you provided does
work for me. -- Best wishes, Jim "CRANSWICK, P" wrote: 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
vba code...... on update...........
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 CRANSWICK, P wrote: ALL SORTED........... I had a merged cell in there which was causing some problems, thanks "CRANSWICK, P" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
update code | Excel Discussion (Misc queries) | |||
How can I update VBA code in a module that is running my VBA code? | Excel Programming | |||
code to update a macro | Excel Programming | |||
Any way to update links tru VBA code? | Excel Programming | |||
Update VBA Module Code | Excel Programming |