VB Code to save a workbook when a cell is selected?

Jay3

Board Regular
Joined
Jul 3, 2009
Messages
237
Hi All,

Can someone help me out with some code please.

I have an excel spreadsheet which contains a simple list for users to add task to give me to do.

When a user adds a task an email is generated to let me know that a new task has been added.

As this is a shared workbook there is the risk that someone will overtype the same line.

Currently each time the macro runs to generate the email it save the workbook. The problem is that if another user is in the workbook at the same time they to have to hit save to refresh the spreadsheet before entering a new line.

The solution I have thought of is this.

Each time a user selects a cell in column A to start to enter a new task I would like the workbook to save automatically.

Can someone assist with the code for this please?

Thanks,
Jay3
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Try this: right click the sheet tab, select View Code and paste in

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 1 Then ThisWorkbook.Save
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,984
Messages
6,122,601
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top