Consulting

Results 1 to 5 of 5

Thread: Solved: How to put "" in a Formula?

  1. #1
    VBAX Contributor
    Joined
    Jun 2006
    Posts
    135
    Location

    Solved: How to put "" in a Formula?

    I have a little issue to define a formula. It may be very simple, but I don't know how to resolve it.

    [VBA]
    Cells(25, 7).Formula = "=CONCATENATE(C12," ",E12," ",D12,F12," Equity")"
    [/VBA]

    The " after C12, is understood by the compilator as the end of the formula, and thus can't read the following. I could create a cell with a single space and concatenate it each time, but this would not be proper code and might slow down the macro. Is there a way to do it directly?

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Try this if I understand you correctly:
    =CONCATENATE(C12," ",E12," ",D12,F12," Equity")
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    Try this.
    Cells(25, 7).Formula = "=CONCATENATE(C12,"" "",E12,"" "",D12,F12,"" Equity"")"

  4. #4
    VBAX Contributor
    Joined
    Jun 2006
    Posts
    135
    Location
    Your solution did not work lucas, you need some "" in the macro.

    Thank you Norie, that works perdectly well!

  5. #5
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Sorry, I misunderstood the question. Thanks Norie
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

Posting Permissions

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