Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
ThalesNate
 
Posts: n/a
Default Cell Contents to identify source Filename


Hi, all

I'm trying to build a macro that will allow users to input file
locations, I'm having a hard time getting the macro to substitute cell
contents for a hard-coded string. I have this:

Workbooks.OpenText Filename:= _
"S:\Departments\Shop Public\Support\stats_liste_MvtStock.txt"
_

I would like to instead have something like this:

Workbooks.OpenText Filename:= _
"cell(D6)" _

In this case D6 would contain the file address on the network. With
that accomplished, users can identify their source files without
rooting around in the code. This can't be too hard, can it?

Thanks,

Nate


--
ThalesNate
------------------------------------------------------------------------
ThalesNate's Profile: http://www.excelforum.com/member.php...o&userid=31037
View this thread: http://www.excelforum.com/showthread...hreadid=549610

  #2   Report Post  
Posted to microsoft.public.excel.misc
Chip Pearson
 
Posts: n/a
Default Cell Contents to identify source Filename

Try

Workbooks.OpenText
Filename:=Worksheets("Sheet1").Range("D6").Value



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"ThalesNate"
wrote
in message
...

Hi, all

I'm trying to build a macro that will allow users to input file
locations, I'm having a hard time getting the macro to
substitute cell
contents for a hard-coded string. I have this:

Workbooks.OpenText Filename:= _
"S:\Departments\Shop Public\Support\stats_liste_MvtStock.txt"
_

I would like to instead have something like this:

Workbooks.OpenText Filename:= _
"cell(D6)" _

In this case D6 would contain the file address on the network.
With
that accomplished, users can identify their source files
without
rooting around in the code. This can't be too hard, can it?

Thanks,

Nate


--
ThalesNate
------------------------------------------------------------------------
ThalesNate's Profile:
http://www.excelforum.com/member.php...o&userid=31037
View this thread:
http://www.excelforum.com/showthread...hreadid=549610



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
How do I get a number or letter to represent cell contents? Formula help Excel Discussion (Misc queries) 2 February 25th 06 11:51 PM
Using contents of a cell in a formula Mike Excel Discussion (Misc queries) 4 June 9th 05 03:10 AM
cell contents Kevin Excel Discussion (Misc queries) 1 March 8th 05 11:23 AM
Insert value of a cell as a filename Ralph Howarth Excel Worksheet Functions 0 January 18th 05 12:03 AM
Display actual contents of cell xmasbob Excel Discussion (Misc queries) 1 December 6th 04 05:09 PM


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

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"