View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Specifying Cells To Copy Across Workbooks Not Working!


The copy and paste part works for me.

Do you have any merged cells?
Is the sheet in ThisWorkbook protected?
Is the code in a standard module - not in a sheet module and
not in the ThisWorkbook module?

Run the code with the Msgbox in it, as shown below, then
look in Cells(n, n) and determine if the value is valid...

n = Sheets("Calculations").Range("A12").Value
With Workbooks("3.xls").Sheets("Sheet1")
.Unprotect "1234"
n = n + 1

Msgbox "n value is " & n

.Rows(.Cells(n, n).Value).Copy
ThisWorkbook.Sheets("DataIn").Rows("3:3").PasteSpe cial _
Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
.Protect "1234"
End With
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"dim"
wrote in message
Thanks Jim, I pasted that section in but I still have the same error! ARGH!!!!
Its giving the same error on the same line! - .Rows(.Cells(n, n).Value).Copy

How can I finish this if I can't bring data from a storage workbook to my
other workbook??? .... sorry...venting over. This is executed upon a button
click.

Anyway, here is the entire code. I didn't post it all before because theres
a lot of random cells being cleared and stuff aside from the key aspect,
which is the code which is not working.
-snip-