Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default The " character

Hello All,

try as I might I'm stumped... How do I add a " character in a cell form VBA?
As in I have a formula that looks something like this:
=Something(get data "12/02/2009" to "13/02/2009")

Everytime i try to assign it via ar ange.value= i run into problems (as it
terminates my statement early)

I know it must be possible, and i immagine it to be something trivial.
Yet... I'm stumped. Any ideas?

Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 89
Default The " character

Hi Janos,

How about CHR(34) & "2/19/2009" in VBA

or CHAR(34) & "2/19'2009" using worksheet functions.

Mike



"Janos" wrote:

Hello All,

try as I might I'm stumped... How do I add a " character in a cell form VBA?
As in I have a formula that looks something like this:
=Something(get data "12/02/2009" to "13/02/2009")

Everytime i try to assign it via ar ange.value= i run into problems (as it
terminates my statement early)

I know it must be possible, and i immagine it to be something trivial.
Yet... I'm stumped. Any ideas?

Thanks in advance

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default The " character


Janos;228673 Wrote:
Hello All,

try as I might I'm stumped... How do I add a " character in a cell form
VBA?
As in I have a formula that looks something like this:
=Something(get data "12/02/2009" to "13/02/2009")

Everytime i try to assign it via ar ange.value= i run into problems (as
it
terminates my statement early)

I know it must be possible, and i immagine it to be something trivial.
Yet... I'm stumped. Any ideas?

Thanks in advance


Hello Janos,

You have to use to use a string to represent the quote and concatenate
your formula together. Easier to understand when you see it...

======================================
Range("A1").Value = "=Something(get data" & Chr$(34) & "12/02/2009" &
Chr$(34) & " to " & Chr$(34) & "13/02/2009" & Chr$(34) & ")"
======================================

Chr$(34) is the character string code for a double quote. You may want
to define a string DQoute and set it to Chr$(34) to make the code easier
to read and understand.

======================================
Dim DQuote
Range("A1").Value = "=Something(get data" & DQuote & "12/02/2009" &
DQuote & " to " & DQuote & "13/02/2009" & DQuote & ")"
======================================


--
Leith Ross

Sincerely,
Leith Ross

'The Code Cage' (http://www.thecodecage.com/)
------------------------------------------------------------------------
Leith Ross's Profile: http://www.thecodecage.com/forumz/member.php?userid=75
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=63765

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
How to delete a "return" character (a "box") in cell of imported d JaxHBT Excel Programming 1 August 12th 08 10:39 PM
Is there a special character for "ALT+ENTER" for text formulae? Bill sailing[_2_] Excel Discussion (Misc queries) 2 March 5th 08 09:52 PM
Change "-" from right first character to left first character to make a negative amount [email protected][_2_] Excel Programming 2 July 27th 07 03:54 PM
How can I convert a character string that contains letters & numbers "£2,456.99 (including flights)" into a numeric? ship Excel Worksheet Functions 4 April 3rd 07 02:35 PM
error: "invalid character in text conent" How do I open this file RTH Excel Discussion (Misc queries) 5 April 23rd 06 03:04 PM


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