ipbr21054
Well-known Member
- Joined
- Nov 16, 2010
- Messages
- 5,738
- Office Version
- 2007
- Platform
- Windows
I have a worksheet that i use for invoices.
Once the invoice is printed i then press a button to run a macro which then clears the values that i have just typed into the cells.
The code on the worksheet has just been changed but the macro which clears the cells is still the same.
The problem that i have now is that not only does the macro clear the cells but it also deletes the code etc in that cell.
Below is the macro code that i use to clear the cell values.
Below is the code in each cell that is used to return the requested values but is then deleted when the macro has run.
Can you advise how to edit or replace the existing macro code so it only clears what i have typed as opposed to also clearing its code which i would like left behind so next invoice is then ready to use again.
Thanks
Once the invoice is printed i then press a button to run a macro which then clears the values that i have just typed into the cells.
The code on the worksheet has just been changed but the macro which clears the cells is still the same.
The problem that i have now is that not only does the macro clear the cells but it also deletes the code etc in that cell.
Below is the macro code that i use to clear the cell values.
Code:
Sub INVCUSTOMERINFO() Application.EnableEvents = False
' *** CUSTOMER DETAILS ***
Range("G13:I18").ClearContents
' *** JOB DETAILS ***
Range("N14:O18").ClearContents
Range("G13").Select
Application.EnableEvents = True
End Sub
Below is the code in each cell that is used to return the requested values but is then deleted when the macro has run.
Code:
=INDEX(DATABASE!R:R,$H$13)
Can you advise how to edit or replace the existing macro code so it only clears what i have typed as opposed to also clearing its code which i would like left behind so next invoice is then ready to use again.
Thanks