hello,
does anybody knows how to set width of cells in excel sheet...
thanks,
nitin
Printable View
hello,
does anybody knows how to set width of cells in excel sheet...
thanks,
nitin
Easiest way is to record a macro doing your needed task. Then check out the generated Module code in the VBA IDE (ALT+F11).
Moved :)
VB Code:
Columns("A:A").ColumnWidth = 19.10 'Or any value
thankks for reply but still i am not able to set width of a range of cells properly...
suppose->
xlssheet is my active worksheet..
now what i am doing is-->
xlsSheet.Columns("d4:z4").ColumnWidth = 19.1
but its showing error now how to correct it?
nitin
Quote:
Originally Posted by RobDog888
You can only set the column width and not a single cell. So take out the "d4:z4" and change it to "D:D". This will adjust the first column D to the number. Repeat for the other columns you want to resize.