Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem writing formula
I'm trying to write a formula with VB but having problems. Cell "C3" cotains a number (12,45) so I want to construct the formula "=B12" in cell "K10". Range("K10").Formula = "= b & Int(C3)" This gives me a #NAME? error in K10. Range("K10").Formula = "= "b" & Int(C3)" VB says "Compile error Expected: End of Statement Range("K10").Formula = "= ""b"" & Int(C3)" This gives me the string value "b12" in "K12" Could somebody please help me with the propper syntax for writing the formula "=b12" in "K10". -- Alf ------------------------------------------------------------------------ Alf's Profile: http://www.excelforum.com/member.php...fo&userid=7112 View this thread: http://www.excelforum.com/showthread...hreadid=558661 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem writing formula
Alf
Try: Range("K10").Formula = "=B" & Int(Range("C3")) Regards Trevor "Alf" wrote in message ... I'm trying to write a formula with VB but having problems. Cell "C3" cotains a number (12,45) so I want to construct the formula "=B12" in cell "K10". Range("K10").Formula = "= b & Int(C3)" This gives me a #NAME? error in K10. Range("K10").Formula = "= "b" & Int(C3)" VB says "Compile error Expected: End of Statement Range("K10").Formula = "= ""b"" & Int(C3)" This gives me the string value "b12" in "K12" Could somebody please help me with the propper syntax for writing the formula "=b12" in "K10". -- Alf ------------------------------------------------------------------------ Alf's Profile: http://www.excelforum.com/member.php...fo&userid=7112 View this thread: http://www.excelforum.com/showthread...hreadid=558661 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem writing formula
Thanks Trevor Worked perfecly!!!! -- Alf ------------------------------------------------------------------------ Alf's Profile: http://www.excelforum.com/member.php...fo&userid=7112 View this thread: http://www.excelforum.com/showthread...hreadid=558661 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem writing formula
You're welcome ... thanks for the feedback
"Alf" wrote in message ... Thanks Trevor Worked perfecly!!!! -- Alf ------------------------------------------------------------------------ Alf's Profile: http://www.excelforum.com/member.php...fo&userid=7112 View this thread: http://www.excelforum.com/showthread...hreadid=558661 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Statement writing problem | Excel Worksheet Functions | |||
Problem writing formula | Excel Worksheet Functions | |||
Formula writing problem | Excel Worksheet Functions | |||
Problem writing formulas - please, please help! | Excel Programming | |||
Please help Frustrating VBA code writing problem | Excel Programming |