it looks like you have the worksheets protected so the macro cant delete anything.
you can get the macro to unprotect the work sheet by adding activesheet.unprotect "summerscales" to the beginning of the macro (just after 'Sub DeleteRow()') and then turning it back on with activesheet.protect "summerscales" just before exit sub
Thanks for your reply Purfleet.
I have the code working correctly as a standalone bit of code. My problem is I need it to run within my code that's already there in the 'Inventory Booked Out' sheet.
When I insert it into there I then experience problems with it.
How are you putting the DeleteRow Sub in the existing ? are you pasting the whole code into a certain part of your existing code??
I noticed that you had the DeleteRow Sub code in module5, so i added a call DeleteRow at LN11 in the code on Sheet4 and apart from Inventory Booked in being protected seem to run okay (not checked output)
Private Sub Worksheet_Change(ByVal Target As Range)
'Unprotect Workbook
Sheets("Inventory Booked Out").Unprotect Password:="summerscales"
Sheets("Inventory Booked In").Unprotect Password:="summerscales"
Sheets("Scans with Date Time Stamp").Unprotect Password:="summerscales"
Sheets("Inventory List").Unprotect Password:="summerscales"
Call DeleteRow
Dim Item As String
Dim strDscrpt As String
Dim strPrice As String
Dim SearchRange As Range
Dim rFound As Range
Dim strBC As String
Thanks Purfleet for your reply and pointing out the obvious to me that I had stupidly missed.
I didn't have 'Inventory Booked In' unprotected. Once I had included that all worked fine in how I already had it set to call DeleteRow.
Hi Sean
Glad it is working - i have found with vba that it is often the most simple things that cause the code to break - i once spent an hour trying to get xlcentre to work only to realise that vba needs the US spelling of Centre, changed to xlcenter and it worked.
Still kicking myself for that one!
Purfleet