Results 1 to 3 of 3

Thread: VBA Lists in Excel 97

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2005
    Posts
    1

    VBA Lists in Excel 97

    Hi,

    I'm sure this is a fairly simple question but I don't seem to be able to find a way of acheiving the result I'm after:

    I have a macro the accesses a number of files and reformats the data within them. The path specified within the macro has a value in it which I would like to make a variable.

    I would then like to update these variable using a list box in a seperate worksheet. The user needs to be able to choose from a selection of userids and the choice then needs to update the path within the specified macro.

    Can anyone tell me how to

    A. Create the List Box and update with the necessary id's.
    B. Amend the macro so that the required part of the file path accepts the value passed from the List Box.

    Many thanks

  2. #2
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,657

    Re: VBA Lists in Excel 97

    Post your Macro code, this will mke it easier for people to see what it is you want to do.

    Am i right in saying that you have a path, with a filename in it, and you would like to make the filename dynamic, depending on some sort of choice by the user???

    Where are you getting your id's from ??, this will effect how you fill your listbox.

  3. #3
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: VBA Lists in Excel 97

    There are several ways to fill the list.
    1) make a table, use code to fill the table then requery the listbox to refresh it.
    2) use a (class) module code to fill the list box, and either put in code to get from a file you select/pass to it or pass the module an array or collection to display
    3) read the file and put in a list of variables then requery the listbox.
    4) Some other method

    As to the other part, in the list hold:
    ID (unique), Path and filename, Display name
    Set the format to 3 columns, with widths : 0;0;1
    The user will see the display bit, the code can grab the text in column (0) for getting the id and column(1) for getting the path.
    This can then be passed to the sub as a string in a variable.

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width