Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default How to disable a macro

I have a spreadsheet virtrually entirely run by macros activated by control
box buttons.

There is a dialog of User name and Password and if there is a match the user
name and position is shown in cells Main!D11 and D12 (respectiviely). The
user name is "picked-up " and added to all printed reports.

I would like to disable the macro if the UserName is "Unauthorised User".

I was wondering if I could insert - at the start of each macro , prior to
the controlled actions, something like....

If Main!D12 = "Unauthorised User" End Sub

I plan to paste the routine prior to all macros.

Can anyone help me here please?

Thanks in anticipation,

sincerely

Jeff Smith


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 473
Default How to disable a macro

Jeff Smith wrote:
I was wondering if I could insert - at the start of each macro , prior to
the controlled actions, something like....

If Main!D12 = "Unauthorised User" End Sub


If Sheets("Main").Range("D12") = "Unauthorised User" Then Exit Sub

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How to disable a macro

Thank you very much for this. This works well.

sincerely

Jeff Smith


"Bill Manville" wrote in message
...
Jeff Smith wrote:
I was wondering if I could insert - at the start of each macro , prior

to
the controlled actions, something like....

If Main!D12 = "Unauthorised User" End Sub


If Sheets("Main").Range("D12") = "Unauthorised User" Then Exit Sub

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup



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
Disable running of SelectionChange macro when in another macro? Tonso Excel Discussion (Misc queries) 6 March 21st 10 06:50 PM
Disable Esc-key - macro yshridhar Excel Discussion (Misc queries) 4 February 9th 08 04:19 AM
How to disable the Macro? Eric Excel Discussion (Misc queries) 1 November 10th 07 04:25 PM
disable user running macro from Tools Macro Steve Simons Excel Discussion (Misc queries) 4 September 28th 06 06:28 AM
Disable Macro at open by an external macro Ricardo[_2_] Excel Programming 0 November 10th 03 07:50 PM


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