Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Formula problem

In a Microsoft Visual Basic for Applications macro (Excel
2000), when I attempt to put a formula in a cell
in some cases I receive the following run-time error:

Run-time error '1004':
Application-defined or object-defined error

For example, the first 3 statements bellow works fine,
but the 4TH doesn't:
..
..
..
Worksheets("Radni nalog").Range("F3").Formula
= "='Planska kalkulacija'!F3:G3"
Worksheets("Radni nalog").Range("H6:Q6").Formula
= "='Planska kalkulacija'!H6:Q6"
Worksheets("Radni nalog").Range("AF6").Formula
= "='Planska kalkulacija'!Y6"
'The next statement doesn't works:
Worksheets("Radni nalog").Range("AC19").Formula = _
"=PRODUCT('Ostvareni indirektni troskovi'!
T12;'Radni nalog'!AC13)/ _
OFFSET('Ostvareni direktni troskovi'!
P10;+'Osnovni podaci'!R8;0;1;1)"
..
..
..
If I remove the equal sign from the beginning of the
formula,
the formula will be placed to the cell!(Of course, it has
no sense without =)

Could anyone help me?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Formula problem

Hi
try replacing the semicolon:
=PRODUCT('Ostvareni indirektni troskovi'!T12,'Radni
nalog'!AC13)/OFFSET('Ostvareni direktni troskovi'!P10,'Osnovni
podaci'!R8,0,1,1)"

--
Regards
Frank Kabel
Frankfurt, Germany

Matyas wrote:
In a Microsoft Visual Basic for Applications macro (Excel
2000), when I attempt to put a formula in a cell
in some cases I receive the following run-time error:

Run-time error '1004':
Application-defined or object-defined error

For example, the first 3 statements bellow works fine,
but the 4TH doesn't:
.
.
.
Worksheets("Radni nalog").Range("F3").Formula
= "='Planska kalkulacija'!F3:G3"
Worksheets("Radni nalog").Range("H6:Q6").Formula
= "='Planska kalkulacija'!H6:Q6"
Worksheets("Radni nalog").Range("AF6").Formula
= "='Planska kalkulacija'!Y6"
'The next statement doesn't works:
Worksheets("Radni nalog").Range("AC19").Formula = _
"=PRODUCT('Ostvareni indirektni troskovi'!
T12;'Radni nalog'!AC13)/ _
OFFSET('Ostvareni direktni troskovi'!
P10;+'Osnovni podaci'!R8;0;1;1)"
.
.
.
If I remove the equal sign from the beginning of the
formula,
the formula will be placed to the cell!(Of course, it has
no sense without =)

Could anyone help me?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Formula problem

You can't put line continuation characters within a string

Worksheets("Radni nalog").Range("AC19").Formula = _
"=PRODUCT('Ostvareni indirektni troskovi'!" & _
"T12;'Radni nalog'!AC13)/" & _
"OFFSET('Ostvareni direktni troskovi'!" & _
"P10;+'Osnovni podaci'!R8;0;1;1)"

Should work.

--

Regards,
Tom Ogilvy

"Matyas" wrote in message
...
In a Microsoft Visual Basic for Applications macro (Excel
2000), when I attempt to put a formula in a cell
in some cases I receive the following run-time error:

Run-time error '1004':
Application-defined or object-defined error

For example, the first 3 statements bellow works fine,
but the 4TH doesn't:
.
.
.
Worksheets("Radni nalog").Range("F3").Formula
= "='Planska kalkulacija'!F3:G3"
Worksheets("Radni nalog").Range("H6:Q6").Formula
= "='Planska kalkulacija'!H6:Q6"
Worksheets("Radni nalog").Range("AF6").Formula
= "='Planska kalkulacija'!Y6"
'The next statement doesn't works:
Worksheets("Radni nalog").Range("AC19").Formula = _
"=PRODUCT('Ostvareni indirektni troskovi'!
T12;'Radni nalog'!AC13)/ _
OFFSET('Ostvareni direktni troskovi'!
P10;+'Osnovni podaci'!R8;0;1;1)"
.
.
.
If I remove the equal sign from the beginning of the
formula,
the formula will be placed to the cell!(Of course, it has
no sense without =)

Could anyone help me?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Formula problem

Hi!

It works!!!!!!
Danke schön!!!!!!

-----Original Message-----
Hi
try replacing the semicolon:
=PRODUCT('Ostvareni indirektni troskovi'!T12,'Radni
nalog'!AC13)/OFFSET('Ostvareni direktni troskovi'!

P10,'Osnovni
podaci'!R8,0,1,1)"

--
Regards
Frank Kabel
Frankfurt, Germany

Matyas wrote:
In a Microsoft Visual Basic for Applications macro

(Excel
2000), when I attempt to put a formula in a cell
in some cases I receive the following run-time error:

Run-time error '1004':
Application-defined or object-defined error

For example, the first 3 statements bellow works fine,
but the 4TH doesn't:
.
.
.
Worksheets("Radni nalog").Range("F3").Formula
= "='Planska kalkulacija'!F3:G3"
Worksheets("Radni nalog").Range("H6:Q6").Formula
= "='Planska kalkulacija'!H6:Q6"
Worksheets("Radni nalog").Range("AF6").Formula
= "='Planska kalkulacija'!Y6"
'The next statement doesn't works:
Worksheets("Radni nalog").Range("AC19").Formula = _
"=PRODUCT('Ostvareni indirektni troskovi'!
T12;'Radni nalog'!AC13)/ _
OFFSET('Ostvareni direktni troskovi'!
P10;+'Osnovni podaci'!R8;0;1;1)"
.
.
.
If I remove the equal sign from the beginning of the
formula,
the formula will be placed to the cell!(Of course, it

has
no sense without =)

Could anyone help me?


.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Formula problem

Hi!

The original line in code wasn't broken, so the solution
is what Frank Kabel wrote.
Thanks anyway!

Regards, Matyas

-----Original Message-----
You can't put line continuation characters within a

string

Worksheets("Radni nalog").Range("AC19").Formula = _
"=PRODUCT('Ostvareni indirektni troskovi'!" &

_
"T12;'Radni nalog'!AC13)/" & _
"OFFSET('Ostvareni direktni troskovi'!" & _
"P10;+'Osnovni podaci'!R8;0;1;1)"

Should work.

--

Regards,
Tom Ogilvy

"Matyas" wrote in

message
...
In a Microsoft Visual Basic for Applications macro

(Excel
2000), when I attempt to put a formula in a cell
in some cases I receive the following run-time error:

Run-time error '1004':
Application-defined or object-defined error

For example, the first 3 statements bellow works fine,
but the 4TH doesn't:
.
.
.
Worksheets("Radni nalog").Range("F3").Formula
= "='Planska kalkulacija'!F3:G3"
Worksheets("Radni nalog").Range("H6:Q6").Formula
= "='Planska kalkulacija'!H6:Q6"
Worksheets("Radni nalog").Range("AF6").Formula
= "='Planska kalkulacija'!Y6"
'The next statement doesn't works:
Worksheets("Radni nalog").Range("AC19").Formula = _
"=PRODUCT('Ostvareni indirektni troskovi'!
T12;'Radni nalog'!AC13)/ _
OFFSET('Ostvareni direktni troskovi'!
P10;+'Osnovni podaci'!R8;0;1;1)"
.
.
.
If I remove the equal sign from the beginning of the
formula,
the formula will be placed to the cell!(Of course, it

has
no sense without =)

Could anyone help me?



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Formula problem

The original line in code wasn't broken, so the solution
is what Frank Kabel wrote.
Thanks anyway!



It certainly was in what you posted: From your post:

"=PRODUCT('Ostvareni indirektni troskovi'!T12;'Radni nalog'!AC13)/ _


see the continuation character inside a quoted string.

If you don't past the actual code, then it is a crap shoot.

Also, if that fixed the actual code, then you don't need to replace the
semicolon if you use FormulaLocal rather than Formula,
so Frank's is one solution among many.



--
Regards,
Tom Ogilvy


"Matyas Kormendy" wrote in message
...
Hi!

The original line in code wasn't broken, so the solution
is what Frank Kabel wrote.
Thanks anyway!

Regards, Matyas

-----Original Message-----
You can't put line continuation characters within a

string

Worksheets("Radni nalog").Range("AC19").Formula = _
"=PRODUCT('Ostvareni indirektni troskovi'!" &

_
"T12;'Radni nalog'!AC13)/" & _
"OFFSET('Ostvareni direktni troskovi'!" & _
"P10;+'Osnovni podaci'!R8;0;1;1)"

Should work.

--

Regards,
Tom Ogilvy

"Matyas" wrote in

message
...
In a Microsoft Visual Basic for Applications macro

(Excel
2000), when I attempt to put a formula in a cell
in some cases I receive the following run-time error:

Run-time error '1004':
Application-defined or object-defined error

For example, the first 3 statements bellow works fine,
but the 4TH doesn't:
.
.
.
Worksheets("Radni nalog").Range("F3").Formula
= "='Planska kalkulacija'!F3:G3"
Worksheets("Radni nalog").Range("H6:Q6").Formula
= "='Planska kalkulacija'!H6:Q6"
Worksheets("Radni nalog").Range("AF6").Formula
= "='Planska kalkulacija'!Y6"
'The next statement doesn't works:
Worksheets("Radni nalog").Range("AC19").Formula = _
"=PRODUCT('Ostvareni indirektni troskovi'!
T12;'Radni nalog'!AC13)/ _
OFFSET('Ostvareni direktni troskovi'!
P10;+'Osnovni podaci'!R8;0;1;1)"
.
.
.
If I remove the equal sign from the beginning of the
formula,
the formula will be placed to the cell!(Of course, it

has
no sense without =)

Could anyone help me?



.



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
Formula problem xintrigue New Users to Excel 3 September 9th 08 03:35 PM
IF/AND Formula Problem CT Excel Worksheet Functions 9 June 11th 08 02:22 AM
Formula problem sunnydazy Excel Discussion (Misc queries) 3 June 7th 08 03:03 PM
Problem with formula numerion Excel Worksheet Functions 5 July 5th 05 11:06 PM
formula problem Kevin Excel Discussion (Misc queries) 1 April 13th 05 02:11 PM


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

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"