Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Macro to delete part of a macro

Hi,

I have create a macro in a wookbook (DB). this macro opens up another
workbook (NF) and copies data from NF.

NF itself has macro's within it. when I open NF through the macro in DB I
want part of the thisworkbook beforeSave macro in NF to be deleted/replaced
is this possible?

code in NF is:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Application.EnableEvents = False
If Range("G5") = "" Or Range("D7") = "" Then
Cancel = True
MsgBox "Please complete all Mandatory Fields"
Else
Run €¯saveme€¯
End If
Application.EnableEvents = True
End Sub

It is the Run "saveme" code that I need to be deleted

Any idea's?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Macro to delete part of a macro

hi
see this site for info on how to do that....
http://cpearson.com/excel/vbe.aspx


regards
FSt1

"Arran" wrote:

Hi,

I have create a macro in a wookbook (DB). this macro opens up another
workbook (NF) and copies data from NF.

NF itself has macro's within it. when I open NF through the macro in DB I
want part of the thisworkbook beforeSave macro in NF to be deleted/replaced
is this possible?

code in NF is:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Application.EnableEvents = False
If Range("G5") = "" Or Range("D7") = "" Then
Cancel = True
MsgBox "Please complete all Mandatory Fields"
Else
Run €¯saveme€¯
End If
Application.EnableEvents = True
End Sub

It is the Run "saveme" code that I need to be deleted

Any idea's?

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
help with part of my macro James Excel Programming 3 March 12th 08 03:41 PM
Macro to delete sheets and saves remaining file does not properly delete module pherrero Excel Programming 0 June 21st 05 04:38 PM
Macro to delete sheets and saves remaining file does not properly delete module bhawane Excel Programming 0 June 21st 05 04:20 PM
ruuning part of a macro from another macro pauluk[_69_] Excel Programming 2 July 26th 04 01:40 PM
macro to delete entire rows when column A is blank ...a quick macro vikram Excel Programming 4 May 3rd 04 08:45 PM


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