Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The first code group works. The second group does not. I get an error:
Run-time error '-2147417848 (80010108)': Method 'Hidden' of object 'Range' failed Any ideas on fixing this? -Using Excel 2000 -Code is placed in Module1 -Original code worked for 2 sheets, when adding 3 sheets, it fails. Original code: Sub AddRowNowMacro() ActiveSheet.Unprotect ("atsi359j") 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 ("atsi359j") Sheets("CompletionTable").Select ActiveSheet.Unprotect ("atsi359j") 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 ("atsi359j") Sheets("PDSR").Select End Sub -------------------------------------------------------------------- Updated code: Sub AddRowNowMacro() 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("Disciplines").Select ActiveSheet.Unprotect ("password") Dim lHiddenRwsc As Long With Cells.SpecialCells(xlCellTypeVisible) lHiddenRwsc = .Areas(1).Rows.Count + 1 .Areas(1)(lHiddenRwsc, 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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What are they supposed to do?
-- Dan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Module error | Excel Discussion (Misc queries) | |||
Module error? | Excel Programming | |||
Module Error | Excel Programming | |||
How do I get rid of "Compile error in hidden module" error message | Excel Discussion (Misc queries) | |||
Compile error in hidden module error | Excel Programming |