LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Run Time error '1004': Application-defined or object-defined e

How about:

sht.Range(sht.Cells(rwn, 3), sht.Cells(rwn, sht.UsedRange.Columns.Count)).Copy _
destination:=sht.Cells(rwn3, 3)



PBcorn wrote:

I have qualified these ranges but still get "object does not support this
property or method" on the paste line:

sht.Range(sht.Cells(rwn3, 3), sht.Cells(rwn3, c)).Paste

I have checked the paste range, it is the same size as the copied range.

"Dave Peterson" wrote:

Qualify the ranges:

sht.Range(sht.Cells(rwn, 3), sht.Cells(rwn, sht.UsedRange.Columns.Count)).Copy

or
with sht
'notice the leading dots!
.Range(.Cells(rwn, 3), .Cells(rwn, .UsedRange.Columns.Count)).Copy
end with

If the code is behind a worksheet, those unqualified ranges refer to the sheet
with the code.

If the code is in a general module, then those unqualified ranges refer to the
activesheet.


PBcorn wrote:

I have the following line of code* causing the above error:

sht.activate

*sht.Range(Cells(rwn, 3), Cells(rwn, sht.UsedRange.Columns.Count)).Copy

this is within a for-next loop:

For Each sht In ThisWorkbook.Worksheets
next sht

rwn is an integer from a line within a another for-next loop:

rwn = cll.row

why is this causing an error?


--

Dave Peterson


--

Dave Peterson
 
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
Export a chart in a GIF file. Run-time error '1004': Application-defined or object-defined error; [email protected] Excel Programming 4 September 16th 07 11:09 PM
Run-time error 1004. Application-defined or object-defined error Martin Brennan Excel Programming 2 June 7th 07 01:22 PM
Run Time Error 1004 - Application-defined or object-defined error brent Excel Programming 2 October 3rd 05 05:23 PM
Run-time Error 1004: Application-defined or Object-defined Error Adrian Excel Programming 6 August 23rd 05 06:28 AM
Macro Run-time Error 1004 Application Defined or Object Defined Error Anddmx Excel Programming 6 June 9th 04 03:40 PM


All times are GMT +1. The time now is 11:49 AM.

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

About Us

"It's about Microsoft Excel"