+ Reply to Thread
Results 1 to 3 of 3

content on textbox within userform

Hybrid View

Guest content on textbox within... 08-15-2006, 03:05 AM
Guest RE: content on textbox within... 08-15-2006, 01:20 PM
Guest RE: content on textbox within... 08-22-2006, 02:50 AM
  1. #1
    sverre
    Guest

    content on textbox within userform

    Hi,

    ChDir "L:\Atla"
    Workbooks.OpenText Filename:="L:\Atla\week32.xls"

    I would like to replace the filename above with the values of three
    textboxes which are within a userform. This should happen when I click "ok"
    in the userform. Name of userform is newweek and name of textboxes are file1,
    file2 and file3

    reason is that there are new weeks and therefore new files...

    Is it possible to do something with the L above? I mean you can map the disk
    with something else than L depending on user.

    many thanks
    Sverre

  2. #2
    Tom Ogilvy
    Guest

    RE: content on textbox within userform

    With Newweek
    s = "L:\" & .file1.text & "\" & .file2.text & "\" & .file3.text &"\"
    End with
    chdrive "L"
    chdir s
    workbooks.Open "Week32.xls"

    is one interpretaton

    Another would be that you want to open 3 files listed in the textboxes
    Dim bk1 as Workbook, bk2 as Workbook, bk3 as Workbook
    chDrive "L"
    chdir "L:\Atla"
    With Newweek
    set bk1 = workbooks.open( .file1.text)
    set bk2 = Workbooks.open( .file2.text)
    set bk3 = Workbooks.open( .file3.text)
    End with

    You show the extension as being .xls, so I would use the Open method rather
    than open text if this indicates they are excel files.

    --
    Regards,
    Tom Ogilvy


    "sverre" wrote:

    > Hi,
    >
    > ChDir "L:\Atla"
    > Workbooks.OpenText Filename:="L:\Atla\week32.xls"
    >
    > I would like to replace the filename above with the values of three
    > textboxes which are within a userform. This should happen when I click "ok"
    > in the userform. Name of userform is newweek and name of textboxes are file1,
    > file2 and file3
    >
    > reason is that there are new weeks and therefore new files...
    >
    > Is it possible to do something with the L above? I mean you can map the disk
    > with something else than L depending on user.
    >
    > many thanks
    > Sverre


  3. #3
    sverre
    Guest

    RE: content on textbox within userform

    As always an excellent answer that works immediately!
    Many thanks Tom!
    Sverker

    "Tom Ogilvy" skrev:

    > With Newweek
    > s = "L:\" & .file1.text & "\" & .file2.text & "\" & .file3.text &"\"
    > End with
    > chdrive "L"
    > chdir s
    > workbooks.Open "Week32.xls"
    >
    > is one interpretaton
    >
    > Another would be that you want to open 3 files listed in the textboxes
    > Dim bk1 as Workbook, bk2 as Workbook, bk3 as Workbook
    > chDrive "L"
    > chdir "L:\Atla"
    > With Newweek
    > set bk1 = workbooks.open( .file1.text)
    > set bk2 = Workbooks.open( .file2.text)
    > set bk3 = Workbooks.open( .file3.text)
    > End with
    >
    > You show the extension as being .xls, so I would use the Open method rather
    > than open text if this indicates they are excel files.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "sverre" wrote:
    >
    > > Hi,
    > >
    > > ChDir "L:\Atla"
    > > Workbooks.OpenText Filename:="L:\Atla\week32.xls"
    > >
    > > I would like to replace the filename above with the values of three
    > > textboxes which are within a userform. This should happen when I click "ok"
    > > in the userform. Name of userform is newweek and name of textboxes are file1,
    > > file2 and file3
    > >
    > > reason is that there are new weeks and therefore new files...
    > >
    > > Is it possible to do something with the L above? I mean you can map the disk
    > > with something else than L depending on user.
    > >
    > > many thanks
    > > Sverre


+ 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