Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default ActiveSheet.Paste error

You can't copy a range with more areas in one time

Try this with Dati.xls open but not active
The sheet where you want to copy from is the active sheet

Sub test()
With Workbooks("Dati.xls").Sheets("Standard")
.Unprotect Password:="xxx"
ActiveSheet.Range("D:F").Copy .Range("A1")
ActiveSheet.Range("I:L").Copy .Range("F1")
.Protect Password:="xxx"
End With
End Sub

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Pier" wrote in message ...
Hello,
i have an error 1004 on Activesheet.Paste, can you explain
me the reason? Thanks

Columns("D:F").Select
Range("D:F,I:L").Select
Range("I1").Activate
Selection.Copy
Windows("Dati.xls").Activate
ActiveSheet.Unprotect Password:="xxx"
Application.ScreenUpdating = False
Range("A1").Select
Sheets("Standard").Select
ActiveSheet.Unprotect Password:="xxx"
Sheets("Standard").Select
ActiveSheet.Paste <--------------------------
Range("G1").Select



Reply
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
How do I name a picture as I paste it from VBA? (ActiveSheet.Past. Leitey Excel Discussion (Misc queries) 4 April 5th 23 01:17 PM
Activesheet.Paste does OK manually between worksheets but not in M Billyruben Excel Discussion (Misc queries) 10 November 28th 08 09:04 PM
ActiveSheet.Paste (error) Puzzled Excel Worksheet Functions 1 August 2nd 07 06:18 PM
ActiveSheet.Paste - Error help? dk_ Excel Discussion (Misc queries) 4 November 20th 06 12:27 AM
Working with Macros-Activesheet.Paste lunar1085 Excel Discussion (Misc queries) 0 February 3rd 06 04:13 PM


All times are GMT +1. The time now is 02:22 PM.

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

About Us

"It's about Microsoft Excel"