Results 1 to 4 of 4

Inputting values into an Array as Text from Text Input mode

Threaded View

  1. #1
    Registered User
    Join Date
    05-23-2008
    Posts
    11

    Inputting values into an Array as Text from Text Input mode

    Hi Guys,

    I'm trying to get text into an array and then use it to form the basis of a folder location but I keep getting a mismatch error.


     
        SourceFolder = Application.InputBox("Enter Source Folder Name. Make sure you do not have any spaces at the end of the line and make sure the line ends with a \ (backslash)", "Source Folder Name", Type:=2)
        ArraySource = Application.InputBox("Enter in the list of file numbers, make sure they are separated by commas", "Enter Comma Separated List", Type:=2)
        EditedArray = Split(Trim(ArraySource), ",")
        FloorPlans = Array(EditedArray)
        Naming = "Floor Plan"
        Extension = ".xls"
        
        For K = 0 To UBound(FloorPlans)
        
        fullpathname = SourceFolder + Naming + FloorPlans(K) + Extension
        Set SrcBook = Workbooks.Open(fullpathname, UpdateLinks:=0)
    So basically, I have a folder of files eg
    Floor Plan A001.xls
    Floor Plan A002.xls
    ...
    Floor Plan Z999.xls

    And I want to selectively open and print a subset of files. So the first text input will take in the folder I'm after for example:
    "C:\Temp\"

    The second input will take in the numbers I want, for example,
    A001, B003, C005

    And I want it to generate the fullpath of "C:\Temp\Floor Plan A001.xls" so that Excel knows which file to open.

    I'm not sure how to assign my variables so that I don't get a mismatch error.

    Oh, the reason why I need to do it in this manner is because I need to open and print files in a specific order.

    I didn't include the rest of the macro where it prints etc, but basically, I don't need the entire folder, I just need to print specific files from it in a specific order governed by the input.

    Any ideas on how to do it?
    Thanks!
    J
    Last edited by romperstomper; 10-04-2010 at 09:07 AM. Reason: mark solved

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