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 disable a macro by calling it from another macro

Hi,

I tried the "Application.EnableEvents" method, but it gave me the erro
1004 "select method of range class failed"

let me try explaining it again:

there is this first macro(1st) which doesnot let anyone select th
cells in the area b2:c2001 and there is another macro(2nd) which want
to copy the contents in the same area and paste the values (past
specialvalues) in that area, but the 1st one doesnt allow .........

i hope i have explained the problem clearly now.....

thanks again for replying!!

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to disable a macro by calling it from another macro

Oops.... sorry... i forgot to metion this:

I have this code written which doesnt let the user to select the cell
(to prevent accidental deletion):

1st macro:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Me.Range("b2:c2001")) Is Nothing Then Exit Sub
Me.Cells(Target.Row, "D").Select

End Sub


Now the problem is that i want a macro which will just copy the b and
columns and paste the values to the same columns, the macro is preet
simple, the problem is that because of the earlier macro, i canno
select the columns.....

2nd Macro:
Sub Macro()

Range("B1:C1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Range("B1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:
_
False, Transpose:=False
End Sub


is there a way where i can turn the fist macro OFF when the secon
macro runs???

thanks for any help!!

--
Message posted 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
Disable running of SelectionChange macro when in another macro? Tonso Excel Discussion (Misc queries) 6 March 21st 10 06:50 PM
disable user running macro from Tools Macro Steve Simons Excel Discussion (Misc queries) 4 September 28th 06 06:28 AM
macro calling another macro + variables yo Excel Discussion (Misc queries) 2 April 5th 06 04:36 PM
Disable Macro at open by an external macro Ricardo[_2_] Excel Programming 0 November 10th 03 07:50 PM
Calling macro in add-in. Clark B Excel Programming 1 July 24th 03 11:05 PM


All times are GMT +1. The time now is 03:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"