Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Run MACRO from the valve of a cell?

Does anyone know if I can run a MACRO from the value of a cell?

If cell "A1" is greater the 42 I would like to either close the worksheet
with out saving or protect if from any more changes.

--
Francis X. Boudreaux

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Run MACRO from the valve of a cell?

Hi
you'll need an event procedure for this. See:
http://www.cpearson.com/excel/events.htm

--
Regards
Frank Kabel
Frankfurt, Germany


FX Boudreaux wrote:
Does anyone know if I can run a MACRO from the value of a cell?

If cell "A1" is greater the 42 I would like to either close the
worksheet with out saving or protect if from any more changes.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 196
Default Run MACRO from the valve of a cell?

You will need an onsheet event.
Right click the sheet tab, view code.
Put this macro into the sheet module

Sub Doobee()
set a=range("A1")
if a.value 42 then
activeworkbook.close false
'changes not saved

end if

end sub

Regards
Mark


-----Original Message-----
Does anyone know if I can run a MACRO from the value of a

cell?

If cell "A1" is greater the 42 I would like to either

close the worksheet
with out saving or protect if from any more changes.

--
Francis X. Boudreaux

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
'IF' Macro to insert cell contents to alternate cell if cell not e Gryndar Excel Worksheet Functions 6 December 20th 08 05:02 PM
Convert cell value from a formula to a valve on save [email protected] Excel Discussion (Misc queries) 2 March 2nd 08 01:39 AM
using a cell value to control a counter inside a macro and displaying macro value ocset Excel Worksheet Functions 1 September 10th 06 05:32 AM
How to pass valve in combobox object to cell chanon Excel Programming 3 October 15th 03 04:25 AM
Question: Cell formula or macro to write result of one cell to another cell Frederik Romanov Excel Programming 1 July 8th 03 03:03 PM


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