Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default setting a range not working, please help

The code looks like this:
Set rngMine = activesheet.range("a1:a5297")
Set rngOther= Worksheets("Sheet2").range("g1:g5297")
rngOther.value = rngMine.value

I recently moved to XP and have been forced to adjust some code that ran fine under NT and 2000.
The one that is driving me crazy is using rngOther.value = rngMine.value.
The line works until the length of the input [rngMine] is 1606.
Then I get "Run-time error '1004' Application-defined or object-defined error."
The maximum length that will propogate under setting one range equal to another is 911, I ran a series of tests and the error occurs at when the input length is 912 or greater.
I am doing this across sheets [can't use fillacrosssheets as the columns on the receiving sheet are different from the input sheet columns.]

HELP!
and thank you!
Dan

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default setting a range not working, please help

I could duplicate your findings. (I got different lengths, though.)

But maybe:

rngMine.Copy
rngOther.PasteSpecial Paste:=xlPasteValues

would work just as well.

Dan Mullen wrote:

The code looks like this:
Set rngMine = activesheet.range("a1:a5297")
Set rngOther= Worksheets("Sheet2").range("g1:g5297")
rngOther.value = rngMine.value

I recently moved to XP and have been forced to adjust some code that ran fine under NT and 2000.
The one that is driving me crazy is using rngOther.value = rngMine.value.
The line works until the length of the input [rngMine] is 1606.
Then I get "Run-time error '1004' Application-defined or object-defined error."
The maximum length that will propogate under setting one range equal to another is 911, I ran a series of tests and the error occurs at when the input length is 912 or greater.
I am doing this across sheets [can't use fillacrosssheets as the columns on the receiving sheet are different from the input sheet columns.]

HELP!
and thank you!
Dan


--

Dave Peterson

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default setting a range not working, please help

I couldn't replicate the problem, so not sure if this as
an alternative workaround might work:

Sub test()
Dim rngMine As Range, rngOther As Range, v
Set rngMine = ActiveSheet.Range("a1:a5297")
Set rngOther = Worksheets("Sheet2").Range("g1:g5297")

rngMine = [ROW(1:5297)]

v = rngMine.Value
rngOther.Value = v

End Sub

Regards,
Peter



-----Original Message-----
The code looks like this:
Set rngMine = activesheet.range("a1:a5297")
Set rngOther= Worksheets("Sheet2").range("g1:g5297")
rngOther.value = rngMine.value

I recently moved to XP and have been forced to adjust

some code that ran fine under NT and 2000.
The one that is driving me crazy is using rngOther.value

= rngMine.value.
The line works until the length of the input [rngMine]

is 1606.
Then I get "Run-time error '1004' Application-defined or

object-defined error."
The maximum length that will propogate under setting one

range equal to another is 911, I ran a series of tests and
the error occurs at when the input length is 912 or
greater.
I am doing this across sheets [can't use fillacrosssheets

as the columns on the receiving sheet are different from
the input sheet columns.]

HELP!
and thank you!
Dan

.

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
Excel Addin:Setting the range to the Excel.Range object range prop Rp007 Excel Worksheet Functions 5 November 24th 06 04:30 PM
VBA setting Range Jeff Excel Discussion (Misc queries) 1 December 2nd 05 07:36 PM
Automatic color setting in Excel still not working right..... Bogeyfre Excel Discussion (Misc queries) 1 June 7th 05 03:03 PM
Setting Major tick to none on charts is not working, is it a bug? Mike J Charts and Charting in Excel 2 December 17th 04 05:59 PM
range setting Mike Harris Excel Programming 5 November 22nd 03 05:07 AM


All times are GMT +1. The time now is 06:25 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"