Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
I have two workbooks, Book1 and 2, called 73.xls and 3.xls. Both are opened before the code below. 73.xls is active when the code reaches this point, and as shown below, the 3rd code line shown is where it switches to 3.xls. But when it gets to line 9 -- Rows(Cells(n, n).Value).Copy -- it crashes. I've tried changing the code a few ways but cant get it working. Does anyone have any ideas? Sheets("Sheet1").Select n = Range("A1").Value Windows("3.xls").Activate With ThisWorkbook.Sheets("Sheet1") .Unprotect "1234" End With Sheets("Sheet1").Select n = n + 1 Rows(Cells(n, n).Value).Copy With ThisWorkbook.Sheets("Sheet1") .Protect "1234" End With Windows("73.xls").Activate With ThisWorkbook.Sheets("DataIn").Rows("3:3") .PasteSpecial _ Paste:=xlPasteValues, _ Operation:=xlNone, _ SkipBlanks:=False, _ Transpose:=False End With |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy non-contiguous cells from all workbooks in folder | Excel Programming | |||
Copy a range of cells to all workbooks in a folder? | Excel Programming | |||
Can't copy data from cells between workbooks within the same excel | Excel Discussion (Misc queries) | |||
Copy and pasting ref cells is not working | Excel Discussion (Misc queries) | |||
Copy cells from other workbooks | Excel Programming |