PC Review


Reply
Thread Tools Rate Thread

copy cell format

 
 
=?Utf-8?B?a3No?=
Guest
Posts: n/a
 
      24th Aug 2007
Hello -
I recorded a macro to copy the format of a range of cells on sheet2 to an
equal range of cells on sheet 1. When I run the macro it copies the data
from sheet 2, but then it runs into a problem on the
"Range("D3449").Select" step and gives me the following error.

select method of range class failed

Sheets("Sheet2").Select
Range("D924").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet1").Select
Range("D3449").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False

Thanks for any info you can give me on this.
 
Reply With Quote
 
 
 
 
=?Utf-8?B?a3No?=
Guest
Posts: n/a
 
      24th Aug 2007
I found the problem. I had the code attached to a command button in sheet 2.
I moved the macro to module in the workbook and it works fine now.

"ksh" wrote:

> Hello -
> I recorded a macro to copy the format of a range of cells on sheet2 to an
> equal range of cells on sheet 1. When I run the macro it copies the data
> from sheet 2, but then it runs into a problem on the
> "Range("D3449").Select" step and gives me the following error.
>
> select method of range class failed
>
> Sheets("Sheet2").Select
> Range("D924").Select
> Application.CutCopyMode = False
> Selection.Copy
> Sheets("Sheet1").Select
> Range("D3449").Select
> Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
> SkipBlanks:=False, Transpose:=False
>
> Thanks for any info you can give me on this.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy worksheet1 to worksheet2, keep cell format eg cell size slocookie Microsoft Excel Misc 2 8th Jan 2010 11:24 AM
Lock Cell Format - Allow copy and paste of data without format change Chris12InKC Microsoft Excel Worksheet Functions 1 11th Mar 2006 04:44 AM
How do I copy data in single cell format to a merged cell format =?Utf-8?B?UGF1bA==?= Microsoft Excel Misc 1 27th Jun 2005 11:00 AM
Copy cell format to cell on another worksht and update automatical =?Utf-8?B?a2V2aW5t?= Microsoft Excel Worksheet Functions 21 19th May 2005 11:07 AM
Copy partial cell character format(s) from one cell to another - an example aztecbrainsurgeon@yahoo.com Microsoft Excel Programming 0 5th May 2005 08:23 PM


Features
 

Advertising
 

Newsgroups
 


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