Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
BEE BEE is offline
external usenet poster
 
Posts: 10
Default ColumnWidth not working...

Here's my code:
rc = 15
ColPlace = 1
For counter = 0 To rc - 1
wb.Worksheets("Sheet1").Columns(ColPlace).ColumnWi dth = 10
ColPlace = ColPlace + 1
Next

I did this cause I couldn't get a range option to work in
this scenario either. How? What am I missing?

Thanks in advance,
B.
  #2   Report Post  
Posted to microsoft.public.excel.programming
BEE BEE is offline
external usenet poster
 
Posts: 10
Default ColumnWidth not working...

FIXED:
rc = 15
ColPlace = 1
For counter = 0 To rc - 1
wb.Sheets(1).Columns(ColPlace).ColumnWidth = 10
ColPlace = ColPlace + 1
Next

Thanks tho,
B

-----Original Message-----
Here's my code:
rc = 15
ColPlace = 1
For counter = 0 To rc - 1
wb.Worksheets("Sheet1").Columns(ColPlace).ColumnW idth =

10
ColPlace = ColPlace + 1
Next

I did this cause I couldn't get a range option to work

in
this scenario either. How? What am I missing?

Thanks in advance,
B.
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ColumnWidth not working...

Sub Tester1()
Set wb = ActiveWorkbook
rc = 15
ColPlace = 1
For counter = 0 To rc - 1
wb.Worksheets("Sheet1").Columns(ColPlace).ColumnWi dth = 10
ColPlace = ColPlace + 1
Next

End Sub


Worked fine for me.

wb.Worksheets("Sheet1").Cells(1,ColPlace).Entireco lumn.ColumnWidth = 10

would also work.

--
Regards,
Tom Ogilvy


"BEE" wrote in message
...
Here's my code:
rc = 15
ColPlace = 1
For counter = 0 To rc - 1
wb.Worksheets("Sheet1").Columns(ColPlace).ColumnWi dth = 10
ColPlace = ColPlace + 1
Next

I did this cause I couldn't get a range option to work in
this scenario either. How? What am I missing?

Thanks in advance,
B.



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
Calculate working days but change working week SamB Excel Discussion (Misc queries) 1 September 1st 08 09:17 PM
How do I reset the columnwidth to sheet-default? schilleman Excel Discussion (Misc queries) 1 October 31st 07 09:06 AM
Columnwidth of a merged cell Jos Vens Excel Programming 2 November 9th 03 11:19 AM
Adding sales from a non working day to the previous working day Alex Excel Programming 1 September 19th 03 08:48 AM


All times are GMT +1. The time now is 09:44 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"