|
-
Mar 15th, 2010, 10:40 AM
#1
Thread Starter
Junior Member
parenthesys VBA
Hi,
I just wanted to know how to write '=CoorY(posx;2)' into a cell from a macro VBA.
Thank you
Last edited by macarena; Mar 16th, 2010 at 06:28 AM.
-
Mar 15th, 2010, 11:07 AM
#2
Re: parenthesys VBA
Thread moved from 'VB.Net' forum to 'Office Development/VBA' forum.
-
Mar 15th, 2010, 11:36 AM
#3
Re: parenthesys VBA
Code:
Worksheets("Sheet1").Range("A18").Formula = "=CoorY(posx;2)"
This, of course, is presuming your forumla is correct and error free.
-
Mar 15th, 2010, 12:27 PM
#4
Thread Starter
Junior Member
Re: parenthesys VBA
I've a problem with that: Error 1004.
Actually I cannot enter the parenthesys in the sequence.
Thank you
-
Mar 15th, 2010, 12:33 PM
#5
Re: parenthesys VBA
Show me the code for CoorY(). What is the semicolon for?
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Mar 16th, 2010, 05:42 AM
#6
Thread Starter
Junior Member
Re: parenthesys VBA
I don't think that the code doesn't matter since I tried to do it with any other function and it didn't work either. For exemple:
Code:
Sheets("Calculs").Range("K83").Formula = "=SOMME(4;5)"
The thing is that I can write until the parenthesis, like :
Code:
Sheets("Calculs").Range("K83").Formula = "=SOMME"
But then if I write:
Code:
Sheets("Calculs").Range("K83").Formula = "=SOMME("
I get the error so I think that there is a special way to write it but I don't find it.
Thank you
Last edited by macarena; Mar 16th, 2010 at 05:47 AM.
-
Mar 16th, 2010, 05:58 AM
#7
Re: parenthesys VBA
you need to show the full function, including the header line
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Mar 16th, 2010, 06:14 AM
#8
Re: parenthesys VBA
Have you mixed-up US-version and France-version of Excel?
France: "=SOMME(4; 5)"
US: "=SUM(4, 5)"
-
Mar 16th, 2010, 06:23 AM
#9
Re: parenthesys VBA
you could try like
Range("a3").Formula = "=somme(4,5)"
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Mar 16th, 2010, 06:25 AM
#10
Thread Starter
Junior Member
Re: parenthesys VBA
ok,
I've just seen what I was doing wrong:
My version is in french and even if in excel you write '=somme(4;5)' directly into the cell, when you want to do it from VBA you have to write :
Code:
Sheets("Sheet1").range("A1").formula="=SUM(4,6)"
So, there are two important things:
-The name of the function in VBA is always in english
-The semicolon in excel is ',' in VBA
Thank you everybody
-
Mar 16th, 2010, 06:57 AM
#11
Thread Starter
Junior Member
Re: parenthesys VBA
I hadn't seen your answers in my last reply, if I had knew I wouldn't have written the same thing again!!!
But yes, it was that, thank you
-
Mar 18th, 2010, 03:13 PM
#12
Re: parenthesys VBA
you can look at using formulalocal to insert formulas in your local language
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|