Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
worksheet_save macro help
Hi everybody
My worksheet contains worksheet_change event based on range name "ID". What i want is when i save or close the workbook i want ID = "". I have written the following code Private Sub Worksheet_save() Range("id") = "" ActiveWorkbook.Save End Sub It works only when i run it from VB window. Any suggestions. Thanks in advance With regards Sreedhar |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
worksheet_save macro help
Hello Sreedhar
This can't work since there is no Worksheet_Save event in Excel. But you can use either Workbook_BeforeSave or Workbook_BeforeClose events instead. HTH Cordially Pascal "yshridhar" a écrit dans le message de news: ... Hi everybody My worksheet contains worksheet_change event based on range name "ID". What i want is when i save or close the workbook i want ID = "". I have written the following code Private Sub Worksheet_save() Range("id") = "" ActiveWorkbook.Save End Sub It works only when i run it from VB window. Any suggestions. Thanks in advance With regards Sreedhar |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
worksheet_save macro help
Hello Pascal
Can you suggest me the BeforeSave or BeforeClose events. Private Sub Worksheet_BeforeSave() Range("id") = "" ActiveWorkbook.Save End Sub The modification is not working. With warm Regards Sreedhar "papou" wrote: Hello Sreedhar This can't work since there is no Worksheet_Save event in Excel. But you can use either Workbook_BeforeSave or Workbook_BeforeClose events instead. HTH Cordially Pascal "yshridhar" a écrit dans le message de news: ... Hi everybody My worksheet contains worksheet_change event based on range name "ID". What i want is when i save or close the workbook i want ID = "". I have written the following code Private Sub Worksheet_save() Range("id") = "" ActiveWorkbook.Save End Sub It works only when i run it from VB window. Any suggestions. Thanks in advance With regards Sreedhar |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
worksheet_save macro help
I n addition:
Place the code into ThisWorkbook Cordially Pascal "papou" a écrit dans le message de news: ... These are **workbook** events as i mentioned. So you will need to amend and also specify which worksheet, eg: Private Sub Workbook_BeforeSave() Worksheets("Your Sheet Name Here").Range("id") = "" Me.Save End Sub HTH Cordially Pascal "yshridhar" a écrit dans le message de news: ... Hello Pascal Can you suggest me the BeforeSave or BeforeClose events. Private Sub Worksheet_BeforeSave() Range("id") = "" ActiveWorkbook.Save End Sub The modification is not working. With warm Regards Sreedhar "papou" wrote: Hello Sreedhar This can't work since there is no Worksheet_Save event in Excel. But you can use either Workbook_BeforeSave or Workbook_BeforeClose events instead. HTH Cordially Pascal "yshridhar" a écrit dans le message de news: ... Hi everybody My worksheet contains worksheet_change event based on range name "ID". What i want is when i save or close the workbook i want ID = "". I have written the following code Private Sub Worksheet_save() Range("id") = "" ActiveWorkbook.Save End Sub It works only when i run it from VB window. Any suggestions. Thanks in advance With regards Sreedhar |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
worksheet_save macro help
Thank you Pascal
with warm regards Sreedhar "papou" wrote: These are **workbook** events as i mentioned. So you will need to amend and also specify which worksheet, eg: Private Sub Workbook_BeforeSave() Worksheets("Your Sheet Name Here").Range("id") = "" Me.Save End Sub HTH Cordially Pascal "yshridhar" a écrit dans le message de news: ... Hello Pascal Can you suggest me the BeforeSave or BeforeClose events. Private Sub Worksheet_BeforeSave() Range("id") = "" ActiveWorkbook.Save End Sub The modification is not working. With warm Regards Sreedhar "papou" wrote: Hello Sreedhar This can't work since there is no Worksheet_Save event in Excel. But you can use either Workbook_BeforeSave or Workbook_BeforeClose events instead. HTH Cordially Pascal "yshridhar" a écrit dans le message de news: ... Hi everybody My worksheet contains worksheet_change event based on range name "ID". What i want is when i save or close the workbook i want ID = "". I have written the following code Private Sub Worksheet_save() Range("id") = "" ActiveWorkbook.Save End Sub It works only when i run it from VB window. Any suggestions. Thanks in advance With regards Sreedhar |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
My excel macro recorder no longer shows up when recording macro | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) |