+ Reply to Thread
Results 1 to 6 of 6

Browse Button Code to obtain single file name

  1. #1
    Valued Forum Contributor Macdave_19's Avatar
    Join Date
    03-14-2007
    Location
    Birmingham, England
    MS-Off Ver
    12.0
    Posts
    808

    Question Browse Button Code to obtain single file name

    Hi All,

    i've looked on the threads and there are some exaples of this but not specfic enough.

    i need code that allows me to browse my PC for Excel Files then select one file and put it's name into the activecell?

    any help is greatly appreciated.

    cheers for any help!!
    Last edited by Macdave_19; 05-29-2009 at 08:37 AM.
    Mr MaGoo
    Magoo.Inc MMVII

    If i've helped please add to my Rep by Clicking on the Blue Scales in the top right hand corner of the post

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: Browse Button Code to obtain single file name

    Good morning Macdave_19
    Quote Originally Posted by Macdave_19 View Post
    i need code that allows me to browse my PC for Excel Files then select one file and put it's name into the activecell?
    How about something like this? It gives the full pathname - is that acceptable?
    Please Login or Register  to view this content.
    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Browse Button Code to obtain single file name

    Try adding this function and this macro into a standard module, then run the macro:
    Please Login or Register  to view this content.
    (Function source)
    Last edited by JBeaucaire; 05-29-2009 at 05:16 AM. Reason: Corrected A1 to Activecell. Sorry about that...
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Valued Forum Contributor Macdave_19's Avatar
    Join Date
    03-14-2007
    Location
    Birmingham, England
    MS-Off Ver
    12.0
    Posts
    808

    Re: Browse Button Code to obtain single file name

    Thanks to both of you guys, i knew it would be something fairly simple, i should really be able to do this by now!!

    cheers

  5. #5
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: Browse Button Code to obtain single file name

    Hi JBeaucaire

    Think your code is a little larger than it needs to be. Something as simple as this would work to extract the filename only :
    Please Login or Register  to view this content.
    DominicB

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Browse Button Code to obtain single file name

    Heh... that's a actually a new function for me, never used that before. InStrRev...sweet...text string search from the END of the string.

    Thanks for that!

+ 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