Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to trigger macro or force autofit

Is it possible to trigger a macro by changing a particular cell?

More specifically, I am running a cell height format macro, and it
would be nice if it would automatically run whenever a cell change was
made.

another solution would be if anyone knows how to make row height
autofit work on merged cells. I don't understand why it doesn't...



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to trigger macro or force autofit

sorry, found another thread already dealing with this...

http://www.excelforum.com/showthread...hreadid=156446



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default how to trigger macro or force autofit

Take a look at the worksheet_Change event macro:

http://cpearson.com/excel/events.htm

One way:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Target.Rows.AutoFit
End Sub

If you have merged cells, take a look he

http://google.com/groups?selm=053101...001280a%40p h
x.gbl



In article ,
lcoreyl wrote:

Is it possible to trigger a macro by changing a particular cell?

More specifically, I am running a cell height format macro, and it
would be nice if it would automatically run whenever a cell change was
made.

another solution would be if anyone knows how to make row height
autofit work on merged cells. I don't understand why it doesn't...

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default how to trigger macro or force autofit

Use the change event to run your macro.

Right click on the worksheet tab and select view code.

in the left dropdown select Worksheet and in the Right, Change, (not
SelectionChange). This will put in the declaration for the change event and
you can call you macro here. The target arguments specify the Cell or
cells that were edited and triggered the event.

--
Regards,
Tom Ogilvy

"lcoreyl" wrote in message
...
Is it possible to trigger a macro by changing a particular cell?

More specifically, I am running a cell height format macro, and it
would be nice if it would automatically run whenever a cell change was
made.

another solution would be if anyone knows how to make row height
autofit work on merged cells. I don't understand why it doesn't...



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



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
Trigger Macro by Worksheet_Change JSnow Excel Discussion (Misc queries) 5 October 2nd 08 06:27 PM
Using date as trigger for macro Mike Milmoe Excel Discussion (Misc queries) 3 May 10th 07 06:43 PM
macro trigger Leslieac Excel Discussion (Misc queries) 3 February 2nd 06 09:08 PM
macro / autofit Jonathan Cooper Excel Discussion (Misc queries) 5 January 9th 06 01:24 PM
EXCEL: trigger web query from macro? Krick Excel Programming 0 August 5th 03 09:12 PM


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