I hope it works on a Mac also.
This does the same as your code. It also clears cell H4. Did you forget that or does it not need clearing?
Put this in a regular module and run it.
What cytop was refering to was that you have two lines at the top that should be only one line. Probably left over from some previous code.
Delete the "Private Sub Worksheet_Change(ByVal Target As Range)" line
By: Leith Ross
Adding the Macro
Select above macro
Copy the macro above pressing the keys CTRL+C
Open your workbook
Press the keys ALT+F11 to open the Visual Basic Editor
Press the keys ALT+I to activate the Insert menu
Press M to insert a Standard Module
Paste the code by pressing the keys CTRL+V
Make any custom changes to the macro if needed at this time.
Save the Macro by pressing the keys CTRL+S
Press the keys ALT+Q to exit the Editor, and return to Excel.
To Run the Macro...
To run the macro from Excel, open the workbook, and press ALT+F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.
Bookmarks