Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Change ColumnWidth for Multiple Columns?

I need to be able to change the column width on multiple columns (all
next to each other) on one sheet (i.e. codename: sheet10) based on
user data selected from a combobox on sheet1.

I have tried using this but it always fails, so I would really
appreciate any help on fixing it:

with sheet10 'codename for sheet
.unprotect
.columns(4,zColCount).columnwidth=dblColWidth ' col D thru # of
columns entered
.protect
end with

Thanks again....AJ

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Change ColumnWidth for Multiple Columns?

how about this? (i added values manually because i don't have your code)

Sub test()
zcolcount = 8
dblColWidth = 12
With Sheet10 'codename for sheet
.Unprotect
.Columns(4).Resize(1, zcolcount).ColumnWidth = dblColWidth '
.Protect
End With

End Sub


--


Gary


"AJ Master" wrote in message
ups.com...
I need to be able to change the column width on multiple columns (all
next to each other) on one sheet (i.e. codename: sheet10) based on
user data selected from a combobox on sheet1.

I have tried using this but it always fails, so I would really
appreciate any help on fixing it:

with sheet10 'codename for sheet
.unprotect
.columns(4,zColCount).columnwidth=dblColWidth ' col D thru # of
columns entered
.protect
end with

Thanks again....AJ



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Change ColumnWidth for Multiple Columns?

One way is to do it like this:

with sheet10 'codename for sheet
.unprotect
.Range(Cells(1, 4), Cells(1, 4 + zcolcount)).ColumnWidth = dblColWidth
.protect
end with




--
Hope that helps.

Vergel Adriano


"AJ Master" wrote:

I need to be able to change the column width on multiple columns (all
next to each other) on one sheet (i.e. codename: sheet10) based on
user data selected from a combobox on sheet1.

I have tried using this but it always fails, so I would really
appreciate any help on fixing it:

with sheet10 'codename for sheet
.unprotect
.columns(4,zColCount).columnwidth=dblColWidth ' col D thru # of
columns entered
.protect
end with

Thanks again....AJ


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Change ColumnWidth for Multiple Columns?

On Apr 11, 12:51 pm, "Gary Keramidas" <GKeramidasATmsn.com wrote:
how about this? (i added values manually because i don't have your code)

Sub test()
zcolcount = 8
dblColWidth = 12
With Sheet10 'codename for sheet
.Unprotect
.Columns(4).Resize(1, zcolcount).ColumnWidth = dblColWidth '
.Protect
End With

End Sub

--

Gary

"AJ Master" wrote in message

ups.com...

I need to be able to change the column width on multiple columns (all
next to each other) on one sheet (i.e. codename: sheet10) based on
user data selected from a combobox on sheet1.


I have tried using this but it always fails, so I would really
appreciate any help on fixing it:


with sheet10 'codename for sheet
.unprotect
.columns(4,zColCount).columnwidth=dblColWidth ' col D thru # of
columns entered
.protect
end with


Thanks again....AJ


Gary,

Yes, thanks that worked perfectly.

AJ

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Change ColumnWidth for Multiple Columns?

On Apr 11, 1:00 pm, Vergel Adriano
wrote:
One way is to do it like this:

with sheet10 'codename for sheet
.unprotect
.Range(Cells(1, 4), Cells(1, 4 + zcolcount)).ColumnWidth = dblColWidth
.protect
end with

--
Hope that helps.

Vergel Adriano

"AJ Master" wrote:
I need to be able to change the column width on multiple columns (all
next to each other) on one sheet (i.e. codename: sheet10) based on
user data selected from a combobox on sheet1.


I have tried using this but it always fails, so I would really
appreciate any help on fixing it:


with sheet10 'codename for sheet
.unprotect
.columns(4,zColCount).columnwidth=dblColWidth ' col D thru # of
columns entered
.protect
end with


Thanks again....AJ


Vergel,

Thanks, your code worked as well. I appreciate everyones help with
this.

AJ

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Columnwidth Jean-Paul Excel Discussion (Misc queries) 1 November 24th 09 02:21 PM
Columns.ColumnWidth error...sometimes T_o_n_y Excel Programming 0 February 11th 07 12:31 AM
ColumnWidth abhimanyu Excel Programming 1 November 10th 06 01:14 PM
Change a Column list into multiple rows & columns angelface Excel Worksheet Functions 3 January 28th 06 01:23 AM
ColumnWidth Dwight[_4_] Excel Programming 2 July 14th 04 08:22 PM


All times are GMT +1. The time now is 06:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"