Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a worksheet with data that I sometimes want to copy to 3 other worksheets rather than entering the data on each sheet individually.
I just recently protected the worksheets and am getting "error 1004", when running the macro. I added the worksheet.unprotect and protect method to account for this, but am getting the error at the ".paste" portion of the macro. Anyone know whats causing it? Code Below: ub mastertermscopy(ByVal wksname As String, ibox() As Integer) Dim z As Byte Worksheets(wksname).Unprotect Password:="xxxxxx" Worksheets(wksname).Range("a11:h51").Copy For z = 3 To 5 If Worksheets(z).Name = wksname Then Else Worksheets(z).Unprotect Password:="xxxxxx" With Worksheets(z) .Select .Range("a11:h51").Select .Paste <-------------------------debugger points to this part of code .ComboBox1.ListIndex = ibox(0) .ComboBox2.ListIndex = ibox(1) .ComboBox3.ListIndex = ibox(2) .ComboBox4.ListIndex = ibox(3) .CheckBox1.Value = CBool(ibox(4)) .CheckBox2.Value = CBool(ibox(5)) .CheckBox3.Value = CBool(ibox(6)) .CheckBox4.Value = CBool(ibox(7)) .CheckBox5.Value = CBool(ibox(8)) .Range("m7").Select End With Worksheets(z).Protect Password:="xxxxxx" End If Next z Worksheets(wksname).Select Worksheets(wksname).Protect Password:="xxxxxx" End Sub Any help would be appreciated....AJ |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error 1004, paste method of Worksheet class failed | Excel Programming | |||
Copy paste to another Workbook, Error 1004 | Excel Programming | |||
Error 1004 Paste method of Worksheet class failed | Excel Programming | |||
runtime error 1004 paste method of worksheet class failed | Excel Programming | |||
Run Time error 1004 Paste Method of Worksheet Class Failed | Excel Programming |