Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following VBA code runs great when the Workbook is not Shared or
Protected. When I do Share The Workbook, the code takes over a minute to copy each row of data. I am forced to cancel the run (via the ESC key) and recieve the following message "'Run Time Error 1004': Copy Method of Range class failed". Do I need to adjust my code to execute in a "Shared Workbook"? If so, how? Could you please provide a solution. Thanks in advance for your assistance! Here's the actual code: Sub Rectangle2_Click() CodeName = InputBox("Enter Project Code") Worksheets("Sheet1").Select Worksheets("Sheet1").Range("A1").Value = CodeName Worksheets("Sheet1").Range("A8:U5000").ClearConten ts RowCount = 8 With Worksheets("Sheet2").Range("A5:U5000") Set c = .Find(Cells(3, 1)) If Not c Is Nothing Then firstAddress = c.Address Do c.EntireRow.Copy _ Destination:=Worksheets("Sheet1").Rows(RowCount) RowCount = RowCount + 1 Set c = .FindNext(c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sharing Worksheet | Excel Worksheet Functions | |||
Sharing data from one worksheet to another | Excel Worksheet Functions | |||
Sharing and protecting sections of a worksheet. | Excel Discussion (Misc queries) | |||
Sharing worksheet with a customer toolbar | Excel Worksheet Functions | |||
Sharing Worksheet cannot complete task | Excel Worksheet Functions |