ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save As (https://www.excelbanter.com/excel-programming/293486-re-save.html)

david mcritchie

Save As
 
I expect you are talking about Event macros
http://www.mvps.org/dmcritchie/excel/event.htm

If you have things happening when you save the file, would look
in ThisWorkBook.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"angiede" wrote in message ...
I have an Excel file with macros that seems to work fine. However, when I hit File-Save As - it runs through all the macros again

and replaces text and changes that have been made to the file. How do I keep macros from running when I exit?



angiede

Save As
 
I'm really new to VB. I'm attaching the code I'm using. I tried a few suggestions from your link - but I don't think I'm really getting it. Can you take a look and let me know? I'm just trying to prevent the code from running again when I go to file save as. If I just hit save - it's fine. But File Save as - runs the code again everytime

Thanks for your help

Private Sub ComboBox1_Change(
Checkcell = "B1
Range(Checkcell).Selec
ActiveCell.FormulaR1C1 = ComboBox1.Valu

Range(Checkcell).Selec
ActiveCell.Offset(5, 0).Range("A1").Selec
If Range(Checkcell).Value2 = "Brand" The
ActiveCell.Value = "Please enter pre and post time periods. The time periods must be of equal length
Els
If Range(Checkcell).Value2 = "Brand1" The
ActiveCell.Value = "Please enter two time periods - note that they don't need to be the same length
Els
If Range(Checkcell).Value2 = "Trial & Repeat" The
ActiveCell.Value = "Please be sure to indicate whether this is a one-time delivery or ongoing
Els
ActiveCell.Value = "
End I
End I
End I

Range(Checkcell).Selec
ActiveCell.Offset(9, 4).Range("A1").Selec
If Range(Checkcell).Value2 = "Crosstab" The
Call PopulateCrosstabMeasures(Checkcell
Els
If Range(Checkcell).Value2 = "Distribution" The
Call DeleteMeasures(Checkcell
Call PopulateDistributionMeasures(Checkcell
Els
Call DeleteMeasures(Checkcell
End I
End I
Range(Checkcell).Selec
ActiveCell.Offset(4, 0).Range("A1").Selec

End Su

----- David McRitchie wrote: ----

I expect you are talking about Event macro
http://www.mvps.org/dmcritchie/excel/event.ht

If you have things happening when you save the file, would loo
in ThisWorkBook
--
HTH
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.ht
Search Page: http://www.mvps.org/dmcritchie/excel/search.ht

"angiede" wrote in message ..
I have an Excel file with macros that seems to work fine. However, when I hit File-Save As - it runs through all the macros agai

and replaces text and changes that have been made to the file. How do I keep macros from running when I exit





All times are GMT +1. The time now is 09:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com