Results 1 to 2 of 2

Thread: VBA - Search Google
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Jan 2019
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default VBA - Search Google

    I have the following code which triggers when the user double clicks on a field:

    Code:
    Application.FollowHyperLink "http://www.google.co.uk/search?q=" & BusinessName


    This works fairly well and opens Google to search for the value in the BusinessName field. However, some Businesses contain "&" - which causes issues... The Google search only returns the text prior to the "&". Is there a way to include all of the field?

    E.g.
    Business Name = Jack & Jones
    Google Search = Jack

  2. #2
    MrExcel MVP
    Junior Admin
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    49,388
    Post Thanks / Like
    Mentioned
    51 Post(s)
    Tagged
    11 Thread(s)

    Default Re: VBA - Search Google

    I think you need to replace all the "&" in your BusinessName field with "+".
    You should be able to do that with the Replace function.
    See: https://www.techonthenet.com/access/...ng/replace.php
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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