LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
rgarber50
 
Posts: n/a
Default Toggling autofit


Hi
I have a simple to do list with a cell that i am using to take notes -
I'm trying to use the following macro to toggle autofit on and off for
a particular cell. I have assigned the macro to a shape on the
worksheet. Problem is I often have to click the shape multiple times in
order for the macro to run. Any ideas why the following macro isn't
working? - I think it must have something to do with my using a shape
on the wks because the macro works fine when I run it from the vba
editor.

Sub RowAutoFit()
Dim StandardHeight
StandardHeight = 29

If Not Selection.RowHeight = StandardHeight Then
Selection.RowHeight = StandardHeight
Else
Selection.Rows.AutoFit
End If

End Sub

Thanks
Richard


--
rgarber50
------------------------------------------------------------------------
rgarber50's Profile: http://www.excelforum.com/member.php...o&userid=11350
View this thread: http://www.excelforum.com/showthread...hreadid=401721

 
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
Can one adjust Format Row Autofit to ensure WYSIWYG when printing GraySmithy Excel Discussion (Misc queries) 2 September 2nd 05 02:26 PM
Autofit makes rows too tall leaftye Excel Discussion (Misc queries) 0 July 7th 05 03:59 PM
Autofit makes rows too tall leaftye Excel Discussion (Misc queries) 0 July 5th 05 05:16 PM
Need code to Autofit Row Height on recalculation Bob Tarburton Excel Discussion (Misc queries) 0 March 4th 05 08:31 PM
Row Autofit Problem Peter Graff Excel Discussion (Misc queries) 3 January 18th 05 10:10 PM


All times are GMT +1. The time now is 05:11 AM.

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"