Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default 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
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
Statement writing problem Clay Excel Worksheet Functions 4 March 15th 07 04:55 PM
Problem writing formula Millicent Excel Worksheet Functions 1 March 29th 06 02:26 AM
Formula writing problem Bob Excel Worksheet Functions 2 November 4th 05 10:33 PM
Problem writing formulas - please, please help! Oliver Kharraz Excel Programming 1 December 1st 03 12:03 PM
Please help Frustrating VBA code writing problem [email protected] Excel Programming 1 August 7th 03 05:23 PM


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