#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 349
Default Macro Boxes

Hello, I created a box and inserted a macro. Now I can click on the box to
run the macro but it won't turn off when I click it again. How can I "Un-run"
the macro by clicking on the box a second time?

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Macro Boxes

hi,
I don't think you can "un-run" an macro. once started a macro runs until it
hits end sub. also macro by-passes all the built in un-do's so once a macro
has run, there are no un-do buttons. if you want to stop a macro before it
completes, try ctrl+break. that is the emergency stop buttons. real good when
you have inadvertenly gotten yourself into a run away loop.

Regards
FSt1

"Peter" wrote:

Hello, I created a box and inserted a macro. Now I can click on the box to
run the macro but it won't turn off when I click it again. How can I "Un-run"
the macro by clicking on the box a second time?

Thanks.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Macro Boxes

Peter

Do you want a toggle on/off macro?

Sample.................

Sub Wrap_Text()
With Selection
.WrapText = Not .WrapText
End With
End Sub

Click once to set wrap text on. Click again to turn off.

I think you posted earlier and got code to color some cells.

Post that code and we'll have a look at toggling.


Gord Dibben MS Excel MVP

On Wed, 3 Oct 2007 16:01:00 -0700, Peter
wrote:

Hello, I created a box and inserted a macro. Now I can click on the box to
run the macro but it won't turn off when I click it again. How can I "Un-run"
the macro by clicking on the box a second time?

Thanks.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 349
Default Macro Boxes

Here is the code that was used to create the color cell macro:

Sub auditt()
Dim sh1 As Worksheet, sh2 As Worksheet
Set sh1 = Sheets("12 Original")
Set sh2 = Sheets("12 Final")
For Each r In sh1.UsedRange
v1 = r.Value
rr = r.Row
cc = r.Column
v2 = sh2.Cells(rr, cc).Value
If v1 < v2 Then
sh2.Cells(rr, cc).Interior.ColorIndex = 36
End If
Next

End Sub

It would be great if we could toggle this to make it turn on/off by pressing
the button.

Thanks.

"Gord Dibben" wrote:

Peter

Do you want a toggle on/off macro?

Sample.................

Sub Wrap_Text()
With Selection
.WrapText = Not .WrapText
End With
End Sub

Click once to set wrap text on. Click again to turn off.

I think you posted earlier and got code to color some cells.

Post that code and we'll have a look at toggling.


Gord Dibben MS Excel MVP

On Wed, 3 Oct 2007 16:01:00 -0700, Peter
wrote:

Hello, I created a box and inserted a macro. Now I can click on the box to
run the macro but it won't turn off when I click it again. How can I "Un-run"
the macro by clicking on the box a second time?

Thanks.



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Macro Boxes

Peter

I will have to work on this. My VBA skills are not great.

Hopefully one of the real experts will come along to help us.


Gord


On Thu, 4 Oct 2007 09:39:00 -0700, Peter
wrote:

Here is the code that was used to create the color cell macro:

Sub auditt()
Dim sh1 As Worksheet, sh2 As Worksheet
Set sh1 = Sheets("12 Original")
Set sh2 = Sheets("12 Final")
For Each r In sh1.UsedRange
v1 = r.Value
rr = r.Row
cc = r.Column
v2 = sh2.Cells(rr, cc).Value
If v1 < v2 Then
sh2.Cells(rr, cc).Interior.ColorIndex = 36
End If
Next

End Sub

It would be great if we could toggle this to make it turn on/off by pressing
the button.

Thanks.

"Gord Dibben" wrote:

Peter

Do you want a toggle on/off macro?

Sample.................

Sub Wrap_Text()
With Selection
.WrapText = Not .WrapText
End With
End Sub

Click once to set wrap text on. Click again to turn off.

I think you posted earlier and got code to color some cells.

Post that code and we'll have a look at toggling.


Gord Dibben MS Excel MVP

On Wed, 3 Oct 2007 16:01:00 -0700, Peter
wrote:

Hello, I created a box and inserted a macro. Now I can click on the box to
run the macro but it won't turn off when I click it again. How can I "Un-run"
the macro by clicking on the box a second time?

Thanks.




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
Macro that can run combo boxes simonsmith Excel Discussion (Misc queries) 0 June 5th 06 05:00 PM
Macro to clear contents of unprotected cells AND drop down boxes JB2010 Excel Discussion (Misc queries) 3 March 30th 06 10:13 AM
How do I get the macro tool boxes to display? Pat New Users to Excel 3 January 19th 06 04:24 AM
How clear the cut/copy blinking boxes after macro John Excel Worksheet Functions 2 January 13th 06 11:37 PM
How do I create a macro to return drop down boxes to first item i. gaalseth Excel Discussion (Misc queries) 1 April 13th 05 09:09 PM


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