Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Open an excel file

I have a program that open an excel file from file selected cell (see below).
However, I have problem to create an offset. What I want is to have the
program to read the new work order number as a third directory and then read
the filename.

Could you please help me with this matter?

Thanks in advance.
Maperalia


A B C D
E
1 WORK ORDER Location Cut FILENAME
2 2563 AA 11 AA @ 11.xls
3 2564 BB 22 BB @ 22.xls
4 2565 CC 33 CC @ 33.xls



Sub OpenSelectFilename()

Dim dcell As Range

Set dcell = ActiveSheet.Range("Bi")
directory = "S:\test\pants\" & dcell.OFFSET(-3, 0).Value & "\"
filetext = Selection.Value & ".xls"
Workbooks.Open directory & filetext
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Open an excel file


Hi,

Could Vlookup() solve your problem ...?

HTH


--
Carim
------------------------------------------------------------------------
Carim's Profile: http://www.excelforum.com/member.php...o&userid=33259
View this thread: http://www.excelforum.com/showthread...hreadid=531755

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Open an excel file

Carim;
Thanks for your quick respond. I wondfer if you can help me to get the
statement done because I replace waht you advised me I did not work..

Thanks.
Maperalia

"Carim" wrote:


Hi,

Could Vlookup() solve your problem ...?

HTH


--
Carim
------------------------------------------------------------------------
Carim's Profile: http://www.excelforum.com/member.php...o&userid=33259
View this thread: http://www.excelforum.com/showthread...hreadid=531755


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Open an excel file

Basically, I have this program (see below) that I want to pick up the value
from the row "B". Which is located 3 columns on the left side in the same
row. Everytime will be a new value in in the column "B". Therefore the
program have to read this value in order to open the file in the work order.

Thanks in Advance.
Maperalia






Sub OpenSelectFilename1()
Dim WO As String

WO = Worksheets("Sheet1").Range("B3")

directory = "C:\test\Pants\" & WO & "\"
filetext = Selection.Value & ".xls"
Workbooks.Open directory & filetext
End Sub




"Carim" wrote:


Hi,

Could Vlookup() solve your problem ...?

HTH


--
Carim
------------------------------------------------------------------------
Carim's Profile: http://www.excelforum.com/member.php...o&userid=33259
View this thread: http://www.excelforum.com/showthread...hreadid=531755


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
excel 2003 saved file will not open without a blank workbook open Bob Excel Discussion (Misc queries) 4 November 11th 06 04:24 PM
In Excel - Use Windows Explorer instead of File Open to open file KymY Excel Discussion (Misc queries) 1 August 5th 06 09:59 PM
workbooks.open function fails to open an existing excel file when used in ASP, but works in VB. san Excel Programming 1 January 3rd 06 03:22 AM
Open email windows can't open, excel shreadsheet file .xls ? skiz Excel Discussion (Misc queries) 0 October 2nd 05 07:03 PM
How do I stop Excel from closing the open file each time I open a. Welsin Setting up and Configuration of Excel 3 January 8th 05 11:16 PM


All times are GMT +1. The time now is 06:26 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"