I have a procedure called Copy Range
How it should work is this: On Workbook Close event
Call CopyRange and CopyRange2 (Sheet20 & Sheet21 respectively)
I have to sheets set to xlveryHidden and having difficulty finding the correct syntax to change the Visible property to visible, if I need to.
I am copies ranges from a visible sheet to a hidden sheet.
Here is the Procedure. I am getting Syntax Error 9 Subscript Out of Range
Public Sub CopyRange()
Dim i As Single
Dim Y As Single
Dim Z As Single
Y = 0
Z = 5
Application.EnableEvents = False
Application.ScreenUpdating = False
ActiveWorkbook.Unprotect Password:="DRS Billing"
Worksheets("Sheet20"
.Visible = -1 (visible = true
For i = 11 To 388 Step 23
Application.Cursor = xlIBeam
Worksheets("Sheet20"
.Unprotect Password:="2Tough"
Worksheets("Personnel"
.Unprotect Password:="2Tough"
Worksheets("Personnel"
.Activate
Range(Cells(i, 1), Cells(Y + 20, 11)).Select
Selection.Copy
Worksheets("Sheet20"
.Activate
Worksheets("Sheet20"
.Cells(Z, 2).Select
Selection.PasteSpecial Paste:=xlPasteValues
Z = Z + 10
Y = Y + 23
Next i
Worksheets("Sheet20"
.Protect Password:="2Tough"
Worksheets("Sheet20"
.Visible = 2
Worksheets("Section I"
.Select
Application.Cursor = xlDefault
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
Will protect the workbook in a later time.
Any help would be great. Thanks!!
How it should work is this: On Workbook Close event
Call CopyRange and CopyRange2 (Sheet20 & Sheet21 respectively)
I have to sheets set to xlveryHidden and having difficulty finding the correct syntax to change the Visible property to visible, if I need to.
I am copies ranges from a visible sheet to a hidden sheet.
Here is the Procedure. I am getting Syntax Error 9 Subscript Out of Range
Public Sub CopyRange()
Dim i As Single
Dim Y As Single
Dim Z As Single
Y = 0
Z = 5
Application.EnableEvents = False
Application.ScreenUpdating = False
ActiveWorkbook.Unprotect Password:="DRS Billing"
Worksheets("Sheet20"
For i = 11 To 388 Step 23
Application.Cursor = xlIBeam
Worksheets("Sheet20"
Worksheets("Personnel"
Worksheets("Personnel"
Range(Cells(i, 1), Cells(Y + 20, 11)).Select
Selection.Copy
Worksheets("Sheet20"
Worksheets("Sheet20"
Selection.PasteSpecial Paste:=xlPasteValues
Z = Z + 10
Y = Y + 23
Next i
Worksheets("Sheet20"
Worksheets("Sheet20"
Worksheets("Section I"
Application.Cursor = xlDefault
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub
Will protect the workbook in a later time.
Any help would be great. Thanks!!