PC Review


Reply
Thread Tools Rate Thread

Copy works using A1:L1 Format but Not Cells(..) Format

 
 
=?Utf-8?B?cm9hZGtpbGw=?=
Guest
Posts: n/a
 
      26th Oct 2006
I have used Range(Cells(a,b),cells(c,d)).Copy in Excel VBA code successfully
before but currently am working on a macro where I use the following
instuction:

wsFrom.Range(Cells(intFRowNum, 1), Cells(intFRowNum, FPMCOL)).Copy

and get an error that reads "Run-tim error '1004'; Application-defined or
object-defined error."

If I substitute the following instruction it works fine (i.e. no error):

wsFrom.Range("A" & intFRowNum & ":" & Chr(64 + FPMCOL) & intFRowNum).Copy

Any idea what's going on?

Will
 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      26th Oct 2006
wsFrom.Range(wsFrom.Cells(intFRowNum, 1), wsFrom.Cells(intFRowNum,
FPMCOL)).Copy

--
regards,
Tom Ogilvy



"roadkill" wrote:

> I have used Range(Cells(a,b),cells(c,d)).Copy in Excel VBA code successfully
> before but currently am working on a macro where I use the following
> instuction:
>
> wsFrom.Range(Cells(intFRowNum, 1), Cells(intFRowNum, FPMCOL)).Copy
>
> and get an error that reads "Run-tim error '1004'; Application-defined or
> object-defined error."
>
> If I substitute the following instruction it works fine (i.e. no error):
>
> wsFrom.Range("A" & intFRowNum & ":" & Chr(64 + FPMCOL) & intFRowNum).Copy
>
> Any idea what's going on?
>
> Will

 
Reply With Quote
 
=?Utf-8?B?cm9hZGtpbGw=?=
Guest
Posts: n/a
 
      26th Oct 2006
Thank you (don't I feel silly)

"Tom Ogilvy" wrote:

> wsFrom.Range(wsFrom.Cells(intFRowNum, 1), wsFrom.Cells(intFRowNum,
> FPMCOL)).Copy
>
> --
> regards,
> Tom Ogilvy
>
>
>
> "roadkill" wrote:
>
> > I have used Range(Cells(a,b),cells(c,d)).Copy in Excel VBA code successfully
> > before but currently am working on a macro where I use the following
> > instuction:
> >
> > wsFrom.Range(Cells(intFRowNum, 1), Cells(intFRowNum, FPMCOL)).Copy
> >
> > and get an error that reads "Run-tim error '1004'; Application-defined or
> > object-defined error."
> >
> > If I substitute the following instruction it works fine (i.e. no error):
> >
> > wsFrom.Range("A" & intFRowNum & ":" & Chr(64 + FPMCOL) & intFRowNum).Copy
> >
> > Any idea what's going on?
> >
> > Will

 
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
how do I copy format (eg colour of cells) in a drop down list SamR Microsoft Excel Worksheet Functions 1 9th Dec 2009 07:01 PM
How do you format cells to copy the formula above it? =?Utf-8?B?d3Bt?= Microsoft Access Database Table Design 2 20th Sep 2006 08:51 PM
Copy the value of a cell, no format, into several cells. =?Utf-8?B?SGFydmV5IEVhc3RtYW4=?= Microsoft Excel Misc 3 30th Jun 2006 03:46 AM
want format cells alignment not format cells font style =?Utf-8?B?SmVhbm5pZSBCZWFu?= Microsoft Excel Misc 2 10th Feb 2006 09:31 AM
Copy format from row above for selected cells al007 Microsoft Excel Programming 2 9th Dec 2005 11:49 AM


Features
 

Advertising
 

Newsgroups
 


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