View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
leonidas[_58_] leonidas[_58_] is offline
external usenet poster
 
Posts: 1
Default columncount and range?


Hi,

I have a some columns from which the columnwidth should be changed. I
have written a piece of code to do that, but I get an error when using
it. I found out that iLastColumn3 gives the outcome "20" instead of
"T".
How should I change the code to get it working? Thanks in advance!


Code:
--------------------
iLastRow3 = Cells(Rows.Count, "B").End(xlUp).Row
iLastColumn3 = Cells(iLastRow3, Columns.Count).End(xlToLeft).Column
Columns("B:B").ColumnWidth = 10
Columns("C", iLastColumn3).ColumnWidth = 9.14
--------------------


--
leonidas
------------------------------------------------------------------------
leonidas's Profile: http://www.excelforum.com/member.php...o&userid=35375
View this thread: http://www.excelforum.com/showthread...hreadid=566638