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

i put this formula to vba
=CONCATENATE("Text", C2)


VBA
Cells(2, 1).Formula = "=CONCATENATE("Text", C2)"


how to deal with the double quote with text? thanks a lot.

tony


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default convert formula to vba


Use the ascii code for a double quote:

Cells(2, 1).Formula = "=CONCATENATE(" & Chr(34) & "Text" & Chr(34) & ", C2)"



"tony wong" schreef in bericht
...
i put this formula to vba
=CONCATENATE("Text", C2)


VBA
Cells(2, 1).Formula = "=CONCATENATE("Text", C2)"


how to deal with the double quote with text? thanks a lot.

tony



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default convert formula to vba

What moon gave you will work but it seems easier to use:
ActiveSheet.Cells(2,1).Formula = "=CONCATENATE(""Text"",C2)"

"tony wong" wrote:

i put this formula to vba
=CONCATENATE("Text", C2)


VBA
Cells(2, 1).Formula = "=CONCATENATE("Text", C2)"


how to deal with the double quote with text? thanks a lot.

tony



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default convert formula to vba

Cells(2, 1).Formula = "=CONCATENATE(""Text"", C2)"

--
Regards,
Tom Ogilvy

"tony wong" wrote in message
...
i put this formula to vba
=CONCATENATE("Text", C2)


VBA
Cells(2, 1).Formula = "=CONCATENATE("Text", C2)"


how to deal with the double quote with text? thanks a lot.

tony



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default convert formula to vba


"JLGWhiz" schreef in bericht
...
What moon gave you will work but it seems easier to use:
ActiveSheet.Cells(2,1).Formula = "=CONCATENATE(""Text"",C2)"



I never understood the need of =CONCATENATE anyway, since strings can easily
be concatenated with the &:

ActiveSheet.Cells(2,1).Value = "Text" & ActiveSheet.Cells(2,3).Value




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default convert formula to vba

Thanks a lot.

they work to me.


"Tom Ogilvy" .gbl...
Cells(2, 1).Formula = "=CONCATENATE(""Text"", C2)"

--
Regards,
Tom Ogilvy

"tony wong" wrote in message
...
i put this formula to vba
=CONCATENATE("Text", C2)


VBA
Cells(2, 1).Formula = "=CONCATENATE("Text", C2)"


how to deal with the double quote with text? thanks a lot.

tony





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
convert vlookup formula to link formula AFA Excel Worksheet Functions 0 February 20th 08 04:24 AM
How to convert a static formula to dynamic formula ? Pisistratus Excel Worksheet Functions 3 July 5th 07 01:54 PM
Excell convert formula row to formula column **Danny** Excel Worksheet Functions 1 January 14th 07 10:03 PM
how to convert a formula into text in order to display the formula Claudio Hartzstein Excel Discussion (Misc queries) 2 July 13th 06 09:58 AM
Convert Normal formula to array formula Pradip Jain Excel Programming 4 May 23rd 05 04:32 PM


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