Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi, i need a macro that will save workbook every time i select a cell in
another row. Can this be done? Thanks! |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
From workbook press Alt+F11 to launch VBE (Visual Basic Editor). From the
left treeview search for the workbook name and click on + to expand it. Within that you should see the following VBAProject(Your_Filename) Microsoft Excel Objects Sheet1(Sheet1) Sheet2(Sheet2) Sheet3(Sheet3) This Workbook Double click 'This WorkBook' and paste the below code to the right code pane. Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range) Static lngRow As Long If Target.Row < lngRow Then Me.Save lngRow = Target.Row End Sub If this post helps click Yes --------------- Jacob Skaria "puiuluipui" wrote: Hi, i need a macro that will save workbook every time i select a cell in another row. Can this be done? Thanks! |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You are the best! Thanks allot!
I have one more question....can this code be made to work every time i move to another cell? Thanks! "Jacob Skaria" a scris: From workbook press Alt+F11 to launch VBE (Visual Basic Editor). From the left treeview search for the workbook name and click on + to expand it. Within that you should see the following VBAProject(Your_Filename) Microsoft Excel Objects Sheet1(Sheet1) Sheet2(Sheet2) Sheet3(Sheet3) This Workbook Double click 'This WorkBook' and paste the below code to the right code pane. Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range) Static lngRow As Long If Target.Row < lngRow Then Me.Save lngRow = Target.Row End Sub If this post helps click Yes --------------- Jacob Skaria "puiuluipui" wrote: Hi, i need a macro that will save workbook every time i select a cell in another row. Can this be done? Thanks! |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Jacob's code as written requires you to select a cell in a different row
before the save takes place. Do you want to save when you select anywhere on any worksheet? Private Sub Workbook_SheetSelectionChange(ByVal Sh As _ Object, ByVal Target As Range) Me.Save End Sub Seems a little excessive to me. Gord Dibben MS Excel MVP On Fri, 13 Nov 2009 00:43:01 -0800, puiuluipui wrote: You are the best! Thanks allot! I have one more question....can this code be made to work every time i move to another cell? Thanks! "Jacob Skaria" a scris: From workbook press Alt+F11 to launch VBE (Visual Basic Editor). From the left treeview search for the workbook name and click on + to expand it. Within that you should see the following VBAProject(Your_Filename) Microsoft Excel Objects Sheet1(Sheet1) Sheet2(Sheet2) Sheet3(Sheet3) This Workbook Double click 'This WorkBook' and paste the below code to the right code pane. Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range) Static lngRow As Long If Target.Row < lngRow Then Me.Save lngRow = Target.Row End Sub If this post helps click Yes --------------- Jacob Skaria "puiuluipui" wrote: Hi, i need a macro that will save workbook every time i select a cell in another row. Can this be done? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to save workbook | Excel Discussion (Misc queries) | |||
Macro to Save just one sheet to new workbook. | Excel Worksheet Functions | |||
Macro to save Single Page to another workbook | Excel Discussion (Misc queries) | |||
writing a macro to save a workbook | Excel Worksheet Functions | |||
Run Macro(save workbook) after cell updated | New Users to Excel |