+ Reply to Thread
Results 1 to 2 of 2

How to change Macro so it searches cell in excel that is selected to open PDF

  1. #1
    Registered User
    Join Date
    03-20-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    1

    How to change Macro so it searches cell in excel that is selected to open PDF

    I have a macro that will open a PDF in a specified location on my directory.

    Currently I need to enter the document number in cell L1 and then run the macro.. how would I change this so it searches the document number that is selected on excel spread sheet? so for example if I had a reference in cell A2 as long as I highlight that in excel with the cursor.. it will open that file.

    here is the code I'm using at the moment...

    Sub PO_Lookup()

    MyPath = "C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe"
    MyFile = "F:\AP\POs\" & Range("L1") & ".pdf"
    Shell MyPath & " " & MyFile, vbNormalFocus

    End Sub

    Thx for your help..

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: How to change Macro so it searches cell in excel that is selected to open PDF

    before you can get an answer, you'll have to comply with rule no. 3. Your lines of codes must be inserted between code tags. These are the # icon in the small toolbar.
    Do this and you should get an answer pretty soon.
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 04-04-2013, 07:18 AM
  2. [SOLVED] Excel Macro: How to open a file with selected path?
    By polimer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-02-2012, 02:29 PM
  3. Replies: 11
    Last Post: 08-31-2010, 01:30 PM
  4. Change a macro to from and absolute cell reference to selected cell.
    By dcgrove in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-05-2010, 01:19 PM
  5. Excel Macro that searches open workbooks
    By ncap0mfq in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-23-2008, 02:09 PM
  6. Creating a macro to open as save other selected Excel sheets
    By Wessie in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-28-2006, 04:40 AM
  7. [SOLVED] Open an Excel File from Selected Cell
    By maperalia in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-14-2006, 04:25 PM

Tags for this Thread

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