LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
dim dim is offline
external usenet poster
 
Posts: 123
Default Specifying Cells To Copy Across Workbooks Not Working!

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy non-contiguous cells from all workbooks in folder dan dungan Excel Programming 8 November 14th 07 08:04 PM
Copy a range of cells to all workbooks in a folder? [email protected][_2_] Excel Programming 1 September 12th 07 07:06 PM
Can't copy data from cells between workbooks within the same excel snakeinbenson Excel Discussion (Misc queries) 7 March 20th 07 08:50 PM
Copy and pasting ref cells is not working Will Excel Discussion (Misc queries) 2 November 30th 06 10:07 PM
Copy cells from other workbooks kronos Excel Programming 1 April 22nd 04 04:57 PM


All times are GMT +1. The time now is 11:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"