Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Open text file based on date.

I am in need of a way to open a text file based on the
date in a worksheet.
I have many text files saved as ST20061007.txt , ST20061006.txt ect. all
files start with ST then the
date. I need to be able to open each file based on
a date inputted into another cell in the workbook,
So if a user enters 10/6/2006 then it would open
the file ST20061006.txt.

Any help would be Great.

Dan

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Open text file based on date.

Hi Dan

You can try this with the date in A1 it open the file that is in C:\

Workbooks.OpenText "C:\ST" & Format(Range("A1"), "yyyymmdd") & ".txt", Origin:=xlWindows

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Dan Jordan" wrote in message ...
I am in need of a way to open a text file based on the
date in a worksheet.
I have many text files saved as ST20061007.txt , ST20061006.txt ect. all
files start with ST then the
date. I need to be able to open each file based on
a date inputted into another cell in the workbook,
So if a user enters 10/6/2006 then it would open
the file ST20061006.txt.

Any help would be Great.

Dan

*** Sent via Developersdex http://www.developersdex.com ***



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Open text file based on date.



Thanks Ron!! worked perfect

Dan

*** Sent via Developersdex http://www.developersdex.com ***
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
Open CSV file, format data and write output to a text file. BristolBloos Excel Programming 1 October 18th 05 03:50 PM
Open file based on yesterday's date ForSale[_59_] Excel Programming 2 September 2nd 05 06:13 AM
How do I import text file, analyze data, export results, open next file Geoffro Excel Programming 2 March 6th 05 08:02 PM
Excel VBA - open text file, replace text, save file? Cybert Excel Programming 2 October 2nd 04 01:05 AM
Open delimited text file to excel without changing data in that file zohanc Excel Programming 1 October 3rd 03 01:06 AM


All times are GMT +1. The time now is 09:44 PM.

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

About Us

"It's about Microsoft Excel"