Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have this code below which does not work with the next sheet. I think it
is ActiveSheet.Unprotect ("password") for the CompletionTable sheet. What is wrong with the code not making it work past the first sheet? Private Sub test_Click() ActiveSheet.Unprotect ("password") Dim lHiddenRws As Long With Cells.SpecialCells(xlCellTypeVisible) lHiddenRws = .Areas(1).Rows.Count + 1 .Areas(1)(lHiddenRws, 1).EntireRow.Hidden = False Range("A1").CurrentRegion.Rows(Range("A1") _ .CurrentRegion.Rows.Count).Copy Destination:= _ Range("A1").CurrentRegion.Rows(Range("A1").Current Region.Rows.Count + 1) End With ActiveSheet.Protect ("password") Sheets("CompletionTable").Select ActiveSheet.Unprotect ("password") Dim lHiddenRwsb As Long With Cells.SpecialCells(xlCellTypeVisible) lHiddenRwsb = .Areas(1).Rows.Count + 1 .Areas(1)(lHiddenRwsb, 1).EntireRow.Hidden = False Range("A1").CurrentRegion.Rows(Range("A1") _ .CurrentRegion.Rows.Count).Copy Destination:= _ Range("A1").CurrentRegion.Rows(Range("A1").Current Region.Rows.Count + 1) End With ActiveSheet.Protect ("password") Sheets("PDSR").Select End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Unprotect sheet command - How do I do this? | Excel Worksheet Functions | |||
protect unprotect sheet vba | Excel Programming | |||
how to Unprotect sheet | Excel Discussion (Misc queries) | |||
Unprotect sheet when printing | Excel Discussion (Misc queries) | |||
unprotect sheet in code and make sheet visible | Excel Programming |