+ Reply to Thread
Results 1 to 6 of 6

Command Button to open a cell

  1. #1
    Registered User
    Join Date
    08-02-2018
    Location
    Douglas Mi
    MS-Off Ver
    2016
    Posts
    17

    Command Button to open a cell

    Hello,


    I'm looking to open a .pdf file with a Command button

    The sheet name is Components and the .pdf is on cell A10


    I have the button installed on the worksheet but not sure what comes next

    I'm trying do something like this:

    Please Login or Register  to view this content.
    Crazy attempt!
    Doesnt work...

    Rob
    Last edited by jeffreybrown; 12-04-2018 at 07:11 PM. Reason: Code tags please!

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Command Button to open a cell

    Hi Rob,

    As long as the full path (directory + filename) is in cell A10 of the Components sheet, this will work:

    Please Login or Register  to view this content.
    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  3. #3
    Registered User
    Join Date
    08-02-2018
    Location
    Douglas Mi
    MS-Off Ver
    2016
    Posts
    17

    Re: Command Button to open a cell

    Hello Robert,

    Thank you for your response.

    I needed to change the worksheet around a little bit

    Would it be possible to obtain the code to open the pdf on cell A10 in the same worksheet

    Something like this:

    Private Sub CommandButton1_Click()
    Open A10
    End Sub

    Rob

  4. #4
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Command Button to open a cell

    Do you mean the sheet the button is on i.e. Active Sheet?

    Please wrap your code in the appropriate tags as jeffreybrown had to do for your first post i.e. [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE]

    Thanks,

    Robert

  5. #5
    Registered User
    Join Date
    08-02-2018
    Location
    Douglas Mi
    MS-Off Ver
    2016
    Posts
    17

    Re: Command Button to open a cell

    Hi Robert,

    This is the assigned Macro I have on my command button.

    The active sheet is Elbe


    Private Sub CommandButton1_Click()
    Worksheets("Elbe").[A10]
    End Sub

    Thanks,

    Rob

  6. #6
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Command Button to open a cell

    Until you wrap your code in the appropriate tags I cannot help I'm afraid.
    Last edited by Trebor76; 12-04-2018 at 09:32 PM.

+ 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. [SOLVED] VBA to open outlook by command button
    By Shamz41 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-13-2018, 10:43 AM
  2. Create Command Button to Copy Cell Value and Open a URL
    By ellenowski in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-18-2017, 01:09 AM
  3. [SOLVED] Test for file open from Command Button on userform - not displaying open already message
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-02-2017, 09:45 AM
  4. [SOLVED] open a hyperlink by command button
    By grkchakri in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-15-2014, 11:29 AM
  5. [SOLVED] Using a command button to open a PDF
    By emilyloz in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-05-2013, 02:29 PM
  6. Open file with command button... but...
    By jfoerch in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-27-2011, 10:33 AM
  7. [SOLVED] command button:Can i use a command button to open diffrrent sheets
    By Hellboy in forum Excel General
    Replies: 0
    Last Post: 11-03-2005, 11:00 AM

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