+ Reply to Thread
Results 1 to 5 of 5

Using InputBox to search for extension of file

  1. #1
    Registered User
    Join Date
    04-07-2015
    Location
    USA
    MS-Off Ver
    2013 pro
    Posts
    3

    Using InputBox to search for extension of file

    Good afternoon all! I am looking to use an InputBox to find all files in a directory with the extension entered by the user via the InputBox. Here is what I came up with on my own, but this obviously doesnt work since I am here seeking some advice from people who actually know what they are doing Any help will be greatly appreciated!!!! :D


    Dim y As String
    Dim filename1 As String
    y = InputBox("enter animal ID")

    Const DirSearch As String = "C:\users\kevin m. costa\Desktop\data\"
    filename1 = Dir(DirSearch & ".y")
    Do Until filename1 = ""
    Call copytest(filename1)
    filename1 = Dir

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Using InputBox to search for extension of file

    Hi km,

    Welcome to the Forum!

    This code syntax is incorrect:
    Please Login or Register  to view this content.
    it should be:

    Please Login or Register  to view this content.
    But why not use something like:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    04-07-2015
    Location
    USA
    MS-Off Ver
    2013 pro
    Posts
    3

    Re: Using InputBox to search for extension of file

    This actually didn't work when I tried running it this morning. It doesn't do anything after that part of the script runs.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Using InputBox to search for extension of file

    Maybe:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-07-2015
    Location
    USA
    MS-Off Ver
    2013 pro
    Posts
    3

    Re: Using InputBox to search for extension of file

    sweet mama cita! Works perfectly! Thank you sooooooooooooooooo much!!!

+ 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. File name + Directory Path too long.......saves file without extension..........
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-28-2016, 03:17 AM
  2. Replies: 4
    Last Post: 10-23-2013, 12:54 AM
  3. Replies: 6
    Last Post: 05-01-2013, 05:33 PM
  4. Replies: 4
    Last Post: 10-24-2008, 11:49 AM
  5. Replies: 2
    Last Post: 08-11-2005, 10:05 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