View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Per Jessen Per Jessen is offline
external usenet poster
 
Posts: 1,533
Default Non existent code reference problem

Hi

I tested your workbook, and the only error I could find was the advanced
filter function in the 'Sub Get_Staff_List()'

Although you have allowed Advanced filter on the protected sheet, it fails
because it also try to copy the cell formatting (colors), which is not
allowed.

While you get the error click Debug to see which line is causing the error
(highlighted in yellow).

Using a Unprotect/Protect statement solved it:

Sheet4.Unprotect
Sheet4.Range("AP1:AP" & LastRowNewData).AdvancedFilter _
Action:=xlFilterCopy, _
CopyToRange:=Sheet4.Range("A" & 48), _
Unique:=True
Sheet4.Protect

Regards,
Per


Hi JLGWhiz - I can copy the code from the sheet, no problem. The problem
is
that I don't think it is this code that is the problem - the error I get -
in a particular circumstance is referencing a macro that does not exist. I
have been through all the code I have written, but cannot find a reference
to this 'nonexistent' 'macro' - the nonexistent macro is apparently
Fill_Rota, but I only have a Fill_Rota_New - Of course I could have missed
it when going though the code, and YES it is true, I did once have a Sub
Fill_Rota() section, but it was renamed Fill_Rota_New and I just can't see
anything referencing Fill_Rota now.

I will put the workbook up in the 'failing' condition that it gets stick
in
- clicking on the A50 cell on the open worksheet will demonstrate the
error
I get.

Any help is very much appreciated

Sheet can be downloaded here;

http://www.jimsthings.com/excel/Timesheet T7a.xls

Thanks