Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Want a column of cells to have drop down box of another text file

I have this spreadsheet that I wanta column of cells to have a drop down box
that would show choices froma text file that periodically gets updated. I
would like the drop down box to "point" to this external file to get it's
data. Is this possible?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Want a column of cells to have drop down box of another text file

Maybe you could have a routine that opens the text file and updates an existing
sheet (maybe even hide that sheet) when the workbook opens.

I created a worksheet named Table, then used Insert|name to create a name that
changed with the amount of data in column A.

Debra Dalgleish has some more notes:
http://contextures.com/xlNames01.html#Dynamic

Then used that range name as the list in a Data|Validation cell.
http://www.contextures.com/xlDataVal01.html
(also from Debra's site).

Then I could use a macro that updated worksheet:

Option Explicit
Sub Auto_Open()
Dim myTextFileName As String
Dim TextWks As Worksheet
Dim TableWks As Worksheet

Set TableWks = ThisWorkbook.Worksheets("Table")

myTextFileName = "C:\myfolder\text.txt"
myTextFileName = "C:\My Documents\Excel\spacedelim.txt"

Workbooks.OpenText Filename:=myTextFileName, _
Origin:=437, StartRow:=1, DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1))

Set TextWks = ActiveSheet

'clean up existing values
TableWks.Cells.Clear

'copy new values
TextWks.Range("A:A").Copy _
Destination:=TableWks.Range("a1")

'close the text file
TextWks.Parent.Close savechanges:=False

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

kspeters wrote:

I have this spreadsheet that I wanta column of cells to have a drop down box
that would show choices froma text file that periodically gets updated. I
would like the drop down box to "point" to this external file to get it's
data. Is this possible?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Want a column of cells to have drop down box of another text f

Thansk Dave I will take a look at this.

"Dave Peterson" wrote:

Maybe you could have a routine that opens the text file and updates an existing
sheet (maybe even hide that sheet) when the workbook opens.

I created a worksheet named Table, then used Insert|name to create a name that
changed with the amount of data in column A.

Debra Dalgleish has some more notes:
http://contextures.com/xlNames01.html#Dynamic

Then used that range name as the list in a Data|Validation cell.
http://www.contextures.com/xlDataVal01.html
(also from Debra's site).

Then I could use a macro that updated worksheet:

Option Explicit
Sub Auto_Open()
Dim myTextFileName As String
Dim TextWks As Worksheet
Dim TableWks As Worksheet

Set TableWks = ThisWorkbook.Worksheets("Table")

myTextFileName = "C:\myfolder\text.txt"
myTextFileName = "C:\My Documents\Excel\spacedelim.txt"

Workbooks.OpenText Filename:=myTextFileName, _
Origin:=437, StartRow:=1, DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1))

Set TextWks = ActiveSheet

'clean up existing values
TableWks.Cells.Clear

'copy new values
TextWks.Range("A:A").Copy _
Destination:=TableWks.Range("a1")

'close the text file
TextWks.Parent.Close savechanges:=False

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

kspeters wrote:

I have this spreadsheet that I wanta column of cells to have a drop down box
that would show choices froma text file that periodically gets updated. I
would like the drop down box to "point" to this external file to get it's
data. Is this possible?


--

Dave Peterson

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
Text entries behaving like numbers jkiser Excel Discussion (Misc queries) 12 August 30th 06 09:29 PM
search column of text cellto identify those cells with specific w Ross Headifen Excel Worksheet Functions 1 July 8th 06 02:49 PM
checking that cells have a value before the workbook will close kcdonaldson Excel Worksheet Functions 8 December 5th 05 04:57 PM
Saved ungrouped cells to a text file EMarre Excel Discussion (Misc queries) 2 August 30th 05 02:19 PM
Read Text File into Excel Using VBA Willie T Excel Discussion (Misc queries) 13 January 8th 05 12:37 AM


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