Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How to enter a formula ?

When I use:

Range("E1").Formula = "=A1*10"

No problem.

When I enter in the spread sheet:

=LEFT(A1,SEARCH(" - ",A1)-1)

No problem.

But when I use:

Range("E1").Formula = "=LEFT(A1,SEARCH(" - ",A1)-1)"

I get "Run-time error 13:.

How can I have VBA enter the second formula ?

Thank you,
Emory


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default How to enter a formula ?

Hi

Range("E1").Formula = "=LEFT(A1,SEARCH("" - "",A1)-1)"

"" - ""
Double them

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Emory Richter" wrote in message m...
When I use:

Range("E1").Formula = "=A1*10"

No problem.

When I enter in the spread sheet:

=LEFT(A1,SEARCH(" - ",A1)-1)

No problem.

But when I use:

Range("E1").Formula = "=LEFT(A1,SEARCH(" - ",A1)-1)"

I get "Run-time error 13:.

How can I have VBA enter the second formula ?

Thank you,
Emory




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How to enter a formula ?

In article ,
says...
Range("E1").Formula = "=LEFT(A1,SEARCH("" - "",A1)-1)"

Thanks for your help, Ron
that solved the problem.

Emory
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to enter a formula ?

Range("E1").Formula = "=LEFT(A1,SEARCH("" - "",A1)-1)"

When you use double quotes within a text string you have to enter two double
quotes to get one.

--
Regards,
Tom Ogilvy



"Emory Richter" wrote in message
m...
When I use:

Range("E1").Formula = "=A1*10"

No problem.

When I enter in the spread sheet:

=LEFT(A1,SEARCH(" - ",A1)-1)

No problem.

But when I use:

Range("E1").Formula = "=LEFT(A1,SEARCH(" - ",A1)-1)"

I get "Run-time error 13:.

How can I have VBA enter the second formula ?

Thank you,
Emory




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default How to enter a formula ?

In article ,
says...
quotes to get one.

Got it!
Thanks for the explaination, Tom

Emory
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
When I enter a formula, Excel shows the formula not the results Pat Adams Excel Worksheet Functions 5 April 4th 23 11:18 AM
When I enter a formula it shows the formula not the result Dominic Excel Discussion (Misc queries) 2 August 4th 08 12:08 PM
can you wrap formula results via a formula eg. Alt Enter Bryan McHugh Excel Discussion (Misc queries) 5 March 8th 07 12:52 AM
What does hitting Ctrl + Shift + Enter to enter a formula do??? Help a n00b out. qwopzxnm Excel Worksheet Functions 2 October 20th 05 09:06 PM
Cannot enter formula in a cell after removing a circular formula Big Corona Excel Worksheet Functions 0 April 5th 05 06:07 PM


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

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"