Consulting

Results 1 to 5 of 5

Thread: Writing the character " into Cell

  1. #1
    VBAX Regular
    Joined
    Apr 2009
    Posts
    59
    Location

    Writing the character " into Cell

    Hi all,

    I woul liked to have my cell contain the following
    =myfun(A3 , "Date")

    where myfun uses "Date" as a string. The problem is that writing this in my macro, treats the " char as the end of my string...
    How do i solve this?

    Thanks!! (i tried the \ like in java but it doesn seem to work. the most annoying thing about looking for help on this is that " isnt recognise as a character in google!!)

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Show us what myFun does.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Regular
    Joined
    Apr 2009
    Posts
    59
    Location
    Quote Originally Posted by xld
    Show us what myFun does.
    It just takes the second input as string. My problem is that I am trying to say:
    Workbooks("book1.xlsm").Worksheets("Sheet1").Cells(3, 1) = "=myfun(A3 , "Date")"

    but of course, this treats it as:
    "=myfun(A3 , " Date ")"
    Is there a character i can put befroe the " to treat it as part of the string?

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Workbooks("book1.xlsm").Worksheets("Sheet1").Cells(3, 1) = "=myfun(A3 , ""Date"")"
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Regular
    Joined
    Apr 2009
    Posts
    59
    Location
    Great thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •