Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 386
Default Copy Format Error

Hi,

The following code gives me a run time error 1004 Select method of range
class failed. Would you have any ideas why?

It came from the recorder as well!

Thanks for your help
LiAD

Sheets("6").Select
Range("D10:L23").Select
Selection.Copy
Sheets("1").Select
Range("D10").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("A1").Select
Sheets("6").Select
Range("A1").Select
Sheets("1").Select
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Copy Format Error

where does the code break??


Sheets("6").Range("D10:L23")..Copy
Sheets("1").Range("D10").PasteSpecial Paste:=xlPasteFormats,
peration:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False


"LiAD" wrote:

Hi,

The following code gives me a run time error 1004 Select method of range
class failed. Would you have any ideas why?

It came from the recorder as well!

Thanks for your help
LiAD

Sheets("6").Select
Range("D10:L23").Select
Selection.Copy
Sheets("1").Select
Range("D10").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("A1").Select
Sheets("6").Select
Range("A1").Select
Sheets("1").Select

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Copy Format Error

typo two dots instead of one, sorry

Sheets("6").Range("D10:L23").Copy 'this line was at fault
Sheets("1").Range("D10").PasteSpecial Paste:=xlPasteFormats,
peration:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False


"Patrick Molloy" wrote:

where does the code break??


Sheets("6").Range("D10:L23")..Copy
Sheets("1").Range("D10").PasteSpecial Paste:=xlPasteFormats,
peration:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False


"LiAD" wrote:

Hi,

The following code gives me a run time error 1004 Select method of range
class failed. Would you have any ideas why?

It came from the recorder as well!

Thanks for your help
LiAD

Sheets("6").Select
Range("D10:L23").Select
Selection.Copy
Sheets("1").Select
Range("D10").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("A1").Select
Sheets("6").Select
Range("A1").Select
Sheets("1").Select

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 386
Default Copy Format Error

Works now.

THanks

"Patrick Molloy" wrote:

typo two dots instead of one, sorry

Sheets("6").Range("D10:L23").Copy 'this line was at fault
Sheets("1").Range("D10").PasteSpecial Paste:=xlPasteFormats,
peration:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False


"Patrick Molloy" wrote:

where does the code break??


Sheets("6").Range("D10:L23")..Copy
Sheets("1").Range("D10").PasteSpecial Paste:=xlPasteFormats,
peration:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False


"LiAD" wrote:

Hi,

The following code gives me a run time error 1004 Select method of range
class failed. Would you have any ideas why?

It came from the recorder as well!

Thanks for your help
LiAD

Sheets("6").Select
Range("D10:L23").Select
Selection.Copy
Sheets("1").Select
Range("D10").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("A1").Select
Sheets("6").Select
Range("A1").Select
Sheets("1").Select

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 523
Default Copy Format Error

Which of the selects causes the problem? It should be highlighted in yellow
if you debug.

I'd guess that either "1" or "6" doesn't exist as a sheet, maybe it's been
renamed.

"LiAD" wrote:

Hi,

The following code gives me a run time error 1004 Select method of range
class failed. Would you have any ideas why?

It came from the recorder as well!

Thanks for your help
LiAD

Sheets("6").Select
Range("D10:L23").Select
Selection.Copy
Sheets("1").Select
Range("D10").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("A1").Select
Sheets("6").Select
Range("A1").Select
Sheets("1").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
Lock Cell Format - Allow copy and paste of data without format change Chris12InKC Excel Worksheet Functions 2 May 9th 23 07:42 PM
Copy/Paste dates from CSV file - date format error? michael.beckinsale Excel Programming 6 May 12th 07 11:05 AM
A visual basic value copy BUG?? - accounting format has copy problem!! [email protected] Excel Programming 3 June 20th 06 04:42 PM
Code Error - Run Time Error 5 (Disable Cut, Copy & Paste) Tim[_36_] Excel Programming 4 April 23rd 04 02:53 AM
How copy format, font, color and border without copy/paste? Michel[_3_] Excel Programming 1 November 5th 03 04:43 PM


All times are GMT +1. The time now is 06:05 AM.

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"