Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to delete a "return" character (a "box") in cell of imported d | Excel Programming | |||
Is there a special character for "ALT+ENTER" for text formulae? | Excel Discussion (Misc queries) | |||
Change "-" from right first character to left first character to make a negative amount | Excel Programming | |||
How can I convert a character string that contains letters & numbers "£2,456.99 (including flights)" into a numeric? | Excel Worksheet Functions | |||
error: "invalid character in text conent" How do I open this file | Excel Discussion (Misc queries) |