Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Application-defined or object-defined error

As the following example indicates, the R1C1 reference
style is used in .FormulaR1C1. The A1 reference style is
used with .Formula


'put numbers 2,4,6 in cell A1, A2 and A3
'get the sum in cell A4 and A5 with 2 difference
'reference styles
Sub test()
Range("A4").FormulaR1C1 = "=SUM(R1C1:R3C1)"

'error :
'Range("A4").FormulaR1C1 = "=SUM($A$1:$A$3)"

Range("A5").Formula = "=SUM($A$1:$A$3)"

End Sub


Examples from Microsoft online help:
Worksheets("Sheet1").Range("A1").Formula = "=$A$4+$A$10"

Worksheets("Sheet1").Range("B1").FormulaR1C1 = "=SQRT
(R1C1)"


-----Original Message-----
hello everyone,

I am using VB 6.0 with SP5 on a win2k pro machine

with office 2k
installed.
The following code:

..Cells(RowNo, tCol).FormulaR1C1 = "=Sum(" & .Cells

(RowNo, tCol - 1).Address
& ":" & .Cells(RowNo, tCol - UBound(arrVehicles)).Address

& ")"

returns a "Application-defined or object-defined error"

1004.

how ever, when i went to debug mode and saw the values it

showed me

$F$20 = Sum($E$20:$C$20)

which is correct, but the error still appears.

wht I am trying to do here is adding up the previous 3

cell values to the
fourth one.
Can any one help me out?


.

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
Run-time error '50290': Application-defined or object-defined erro Macro button Excel Discussion (Misc queries) 1 March 12th 09 10:59 AM
Application-defined or object-defined error Please Help [email protected] Excel Discussion (Misc queries) 1 April 3rd 06 01:00 PM
Application-defined or object-defined error jaf Excel Programming 0 September 8th 03 07:01 PM
Runtime Error 1004 -- Application Defined or Object Defined Error John[_51_] Excel Programming 3 September 4th 03 04:28 PM
VBA - Application-defined or object-defined error Chip Pearson Excel Programming 0 August 24th 03 08:43 PM


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