Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 20
Default Enabling Macro with the worksheet file

first of all Thanks to Fst1
I have recently created a macro, it works fine once when I execute selecting
Tools-Macro -Run.
I want the macro to be executed every moment I enter data, Instead of I
running this macro each & every time I enter the data.(i.e., results to be
displayed on the worksheet.)

Also How can I automate this process of opening this particular worksheet,
prompt user to enter data, run the macro and display the result.

Opening worksheet is once, calculating for different user inputs until user
says enough.

Pl let me know

Regards
--
reply to my posts are welcome
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Enabling Macro with the worksheet file

Let's say your macro is called macro1.

Install the following worksheet event macro to work with your original macro:

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Call macro1
Application.EnableEvents = True
End Sub


Because it is worksheet code, it is very easy to install and automatic to use:

1. right-click the tab name near the bottom of the Excel window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you have any concerns, first try it on a trial worksheet.

If you save the workbook, the macro will be saved with it.


To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm

--
Gary''s Student - gsnu200751


"NSNR" wrote:

first of all Thanks to Fst1
I have recently created a macro, it works fine once when I execute selecting
Tools-Macro -Run.
I want the macro to be executed every moment I enter data, Instead of I
running this macro each & every time I enter the data.(i.e., results to be
displayed on the worksheet.)

Also How can I automate this process of opening this particular worksheet,
prompt user to enter data, run the macro and display the result.

Opening worksheet is once, calculating for different user inputs until user
says enough.

Pl let me know

Regards
--
reply to my posts are welcome

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 20
Default Enabling Macro with the worksheet file

Hi
Thanks for your reply
It worked.

Regards

--
reply to my posts are welcome


"Gary''s Student" wrote:

Let's say your macro is called macro1.

Install the following worksheet event macro to work with your original macro:

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Call macro1
Application.EnableEvents = True
End Sub


Because it is worksheet code, it is very easy to install and automatic to use:

1. right-click the tab name near the bottom of the Excel window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you have any concerns, first try it on a trial worksheet.

If you save the workbook, the macro will be saved with it.


To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm

--
Gary''s Student - gsnu200751


"NSNR" wrote:

first of all Thanks to Fst1
I have recently created a macro, it works fine once when I execute selecting
Tools-Macro -Run.
I want the macro to be executed every moment I enter data, Instead of I
running this macro each & every time I enter the data.(i.e., results to be
displayed on the worksheet.)

Also How can I automate this process of opening this particular worksheet,
prompt user to enter data, run the macro and display the result.

Opening worksheet is once, calculating for different user inputs until user
says enough.

Pl let me know

Regards
--
reply to my posts are welcome

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
On a DDE Linked worksheet : Copy and Paste Value to a to a file via a macro ? Martin Links and Linking in Excel 0 November 20th 06 11:19 AM
enabling xml on excel vojo Excel Discussion (Misc queries) 1 November 15th 06 08:38 PM
macro save a file name from a cell in 1st worksheet karene Excel Discussion (Misc queries) 2 April 10th 06 12:13 PM
Opening a file and enabling macros automatically Fernandoalberte Excel Discussion (Misc queries) 1 June 29th 05 12:31 PM
Enabling macros Pennington Excel Worksheet Functions 1 December 2nd 04 07:43 PM


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