#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro error

I keep getting the error run-time error '1004': application-defined
object-defined error. This only happens when my row reff is 100 any
other number it works fine I cna change it to 99 and it works 101
perfect. Here is the line that is giving the error.
Workbooks("ODE VZBT CRMG Lvl2 AM 1.xls").Sheets("Sheet1").Range("E" &
RowRef(1) & ":P" & RowRef(1) & ",E" & RowRef(2) & ":P" & RowRef(2) &
",E" & RowRef(3) & ":P" & RowRef(3) & ",E" & RowRef(4) & ":P" &
RowRef(4) & ",E" & RowRef(5) & ":P" & RowRef(5) & ",E" & RowRef(6) &
":P" & RowRef(6) & ",E" & RowRef(7) & ":P" & RowRef(7) & ",E" &
RowRef(8) & ":P" & RowRef(8) & ",E" & RowRef(9) & ":P" & RowRef(9) &
",E" & RowRef(10) & ":P" & RowRef(10) & ",E" & RowRef(11) & ":P" &
RowRef(11) & ",E" & RowRef(12) & ":P" & RowRef(12) & ",E" & RowRef(13)
& ":P" & RowRef(13) & ",E" & RowRef(14) & ":P" & RowRef(14) & ",E" &
RowRef(15) & ":P" & RowRef(15) & ",E" & RowRef(16) & ":P" & RowRef(16)
_
& ",E" & RowRef(17) & ":P" & RowRef(17) & ",E" & RowRef(18) &
":P" & RowRef(18) & ",E" & RowRef(19) & ":P" & RowRef(19) & ",E" &
RowRef(20) & ":P" & RowRef(20) & ",E" & RowRef(21) & ":P" & RowRef(21)
& ",E" & RowRef(22) & ":P" & RowRef(22) & ",E" & RowRef(23) & ":P" &
RowRef(23) & ",E" & RowRef(24) & ":P" & RowRef(24) & ",E" & RowRef(25)
& ":P" & RowRef(25) & ",E" & RowRef(26) & ":P" & RowRef(26) & ",E" &
RowRef(27) & ":P" & RowRef(27) & ",E" & RowRef(28) & ":P" & RowRef(28)
& ",E" & RowRef(29) & ":P" & RowRef(29)).Copy

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 167
Default Macro error

What is the code of RowRef?

" wrote:

I keep getting the error run-time error '1004': application-defined
object-defined error. This only happens when my row reff is 100 any
other number it works fine I cna change it to 99 and it works 101
perfect. Here is the line that is giving the error.
Workbooks("ODE VZBT CRMG Lvl2 AM 1.xls").Sheets("Sheet1").Range("E" &
RowRef(1) & ":P" & RowRef(1) & ",E" & RowRef(2) & ":P" & RowRef(2) &
",E" & RowRef(3) & ":P" & RowRef(3) & ",E" & RowRef(4) & ":P" &
RowRef(4) & ",E" & RowRef(5) & ":P" & RowRef(5) & ",E" & RowRef(6) &
":P" & RowRef(6) & ",E" & RowRef(7) & ":P" & RowRef(7) & ",E" &
RowRef(8) & ":P" & RowRef(8) & ",E" & RowRef(9) & ":P" & RowRef(9) &
",E" & RowRef(10) & ":P" & RowRef(10) & ",E" & RowRef(11) & ":P" &
RowRef(11) & ",E" & RowRef(12) & ":P" & RowRef(12) & ",E" & RowRef(13)
& ":P" & RowRef(13) & ",E" & RowRef(14) & ":P" & RowRef(14) & ",E" &
RowRef(15) & ":P" & RowRef(15) & ",E" & RowRef(16) & ":P" & RowRef(16)
_
& ",E" & RowRef(17) & ":P" & RowRef(17) & ",E" & RowRef(18) &
":P" & RowRef(18) & ",E" & RowRef(19) & ":P" & RowRef(19) & ",E" &
RowRef(20) & ":P" & RowRef(20) & ",E" & RowRef(21) & ":P" & RowRef(21)
& ",E" & RowRef(22) & ":P" & RowRef(22) & ",E" & RowRef(23) & ":P" &
RowRef(23) & ",E" & RowRef(24) & ":P" & RowRef(24) & ",E" & RowRef(25)
& ":P" & RowRef(25) & ",E" & RowRef(26) & ":P" & RowRef(26) & ",E" &
RowRef(27) & ":P" & RowRef(27) & ",E" & RowRef(28) & ":P" & RowRef(28)
& ",E" & RowRef(29) & ":P" & RowRef(29)).Copy


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Macro error

I suggest you find a better way of defining your ranges, as this is
unreadable.

NickHK

wrote in message
oups.com...
I keep getting the error run-time error '1004': application-defined
object-defined error. This only happens when my row reff is 100 any
other number it works fine I cna change it to 99 and it works 101
perfect. Here is the line that is giving the error.
Workbooks("ODE VZBT CRMG Lvl2 AM 1.xls").Sheets("Sheet1").Range("E" &
RowRef(1) & ":P" & RowRef(1) & ",E" & RowRef(2) & ":P" & RowRef(2) &
",E" & RowRef(3) & ":P" & RowRef(3) & ",E" & RowRef(4) & ":P" &
RowRef(4) & ",E" & RowRef(5) & ":P" & RowRef(5) & ",E" & RowRef(6) &
":P" & RowRef(6) & ",E" & RowRef(7) & ":P" & RowRef(7) & ",E" &
RowRef(8) & ":P" & RowRef(8) & ",E" & RowRef(9) & ":P" & RowRef(9) &
",E" & RowRef(10) & ":P" & RowRef(10) & ",E" & RowRef(11) & ":P" &
RowRef(11) & ",E" & RowRef(12) & ":P" & RowRef(12) & ",E" & RowRef(13)
& ":P" & RowRef(13) & ",E" & RowRef(14) & ":P" & RowRef(14) & ",E" &
RowRef(15) & ":P" & RowRef(15) & ",E" & RowRef(16) & ":P" & RowRef(16)
_
& ",E" & RowRef(17) & ":P" & RowRef(17) & ",E" & RowRef(18) &
":P" & RowRef(18) & ",E" & RowRef(19) & ":P" & RowRef(19) & ",E" &
RowRef(20) & ":P" & RowRef(20) & ",E" & RowRef(21) & ":P" & RowRef(21)
& ",E" & RowRef(22) & ":P" & RowRef(22) & ",E" & RowRef(23) & ":P" &
RowRef(23) & ",E" & RowRef(24) & ":P" & RowRef(24) & ",E" & RowRef(25)
& ":P" & RowRef(25) & ",E" & RowRef(26) & ":P" & RowRef(26) & ",E" &
RowRef(27) & ":P" & RowRef(27) & ",E" & RowRef(28) & ":P" & RowRef(28)
& ",E" & RowRef(29) & ":P" & RowRef(29)).Copy



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
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Worksheet Functions 1 May 3rd 08 02:35 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Discussion (Misc queries) 1 May 3rd 08 10:52 AM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
naming tab macro error runtime error 1004 D Excel Programming 3 February 28th 05 01:32 AM
Macro 'Automation error' with ChemOffice Excel macro Stew Excel Programming 0 October 27th 03 08:26 PM


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