+ Reply to Thread
Results 1 to 4 of 4

How to input quotation marks within a cell using VBA

  1. #1
    Registered User
    Join Date
    05-11-2008
    MS-Off Ver
    2010
    Posts
    91

    How to input quotation marks within a cell using VBA

    So here's my code:

    Please Login or Register  to view this content.
    So the variable SearchCrit is what I input on the Inputbox. However, let's say if I'm searching for the word RED in cell D6, unless I input RED as "RED" in the Inputbox, the formula won't work correctly. Is there a way to input the " " within the cell using VBA so I don't have to manually type it in the Inputbox?

  2. #2
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    Here you go!
    Please Login or Register  to view this content.
    Not all forums are the same - seek and you shall find

  3. #3
    Registered User
    Join Date
    05-11-2008
    MS-Off Ver
    2010
    Posts
    91
    Yeah, I actually figured it out. Here's what I did:

    Please Login or Register  to view this content.
    I just had to add 4 quotation marks and that did the trick. Not sure what the logic behind what I did was, but it works. If anyone knows the logic please chime in.

  4. #4
    Registered User
    Join Date
    05-11-2008
    MS-Off Ver
    2010
    Posts
    91
    Thanks Simon, yours actually makes more sense than what I did. I just threw in a bunch of quotation marks and it happened to work. I like your way much better. Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1