I have a small problem (I hope)
I have created an advanced filter using this code:
code:
--------------------------------------------------------------------------------
Sub Filter_Copy()
Worksheets("Kampagneprioritering").Range("N4:AB1004").Delete
Application.ScreenUpdating = False
Sheets("Data").Activate
Names.Add Name:="Raw_Data", RefersTo:=Range("A8:N8", Range("A8:N8").End(xlDown))
Range("Raw_Data").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:= _
Range("A1
6"), CopyToRange:=Range("Kampagneprioritering!N4"), Unique:=False
Sheets("Kampagneprioritering").Activate
End Sub
--------------------------------------------------------------------------------
It copies the filtered rows from sheet2 ("Data") to sheet1 ("Kampagneprioritering")
Now I need to lock all cells in sheet1 and only allow a few cells in sheet1 to be changed. If I look all cells except for those few, I get an error that says it can't do the delete:
Worksheets("Kampagneprioritering").Range("N4:AB1004").Delete
No matter what I do, even if I allow all possible changes while cells are locked it doesn't do the trick. I'm a little stocked here, and hope for some help. Is there something in my vb code I need to add or?
In advance tx
I have created an advanced filter using this code:
code:
--------------------------------------------------------------------------------
Sub Filter_Copy()
Worksheets("Kampagneprioritering").Range("N4:AB1004").Delete
Application.ScreenUpdating = False
Sheets("Data").Activate
Names.Add Name:="Raw_Data", RefersTo:=Range("A8:N8", Range("A8:N8").End(xlDown))
Range("Raw_Data").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:= _
Range("A1
Sheets("Kampagneprioritering").Activate
End Sub
--------------------------------------------------------------------------------
It copies the filtered rows from sheet2 ("Data") to sheet1 ("Kampagneprioritering")
Now I need to lock all cells in sheet1 and only allow a few cells in sheet1 to be changed. If I look all cells except for those few, I get an error that says it can't do the delete:
Worksheets("Kampagneprioritering").Range("N4:AB1004").Delete
No matter what I do, even if I allow all possible changes while cells are locked it doesn't do the trick. I'm a little stocked here, and hope for some help. Is there something in my vb code I need to add or?
In advance tx