Mar 31, 2005 #1 dBjason Programmer Joined Mar 25, 2005 Messages 355 Location US Trying to automate a worksheet, would like to know how to autofit column width (like when you double-click inbetween columns) in VBA. Anybody know?
Trying to automate a worksheet, would like to know how to autofit column width (like when you double-click inbetween columns) in VBA. Anybody know?
Mar 31, 2005 #2 dhulbert Technical User Joined Jun 26, 2003 Messages 1,136 Location GB dbjason Columns("D").EntireColumn.AutoFit Bes tway to find things like this is to use the macro recorder to record you doing it then have a look at the code that is generated. Upvote 0 Downvote
dbjason Columns("D").EntireColumn.AutoFit Bes tway to find things like this is to use the macro recorder to record you doing it then have a look at the code that is generated.
Apr 2, 2005 #3 byundt Technical User Joined Jun 26, 2004 Messages 602 Location US Note that AutoFit won't work on merged cells. If this issue is important to you, a much more sophisticated macro is required. Upvote 0 Downvote
Note that AutoFit won't work on merged cells. If this issue is important to you, a much more sophisticated macro is required.