Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UserForm1 Not Displaying Textbox Content Jim May Excel Programming 4 August 3rd 06 12:57 PM
Check the content of a textbox? leonidas[_32_] Excel Programming 6 July 4th 06 09:00 AM
Textbox Content Type KingG Excel Programming 4 May 12th 06 03:26 PM
Copy a cell content into a TextBox snaggy^^ Excel Programming 1 January 19th 06 10:40 PM
UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E[_2_] Excel Programming 1 July 28th 03 07:36 PM


All times are GMT +1. The time now is 05:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"