Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Glad it worked for you.
ps. You should stop watching the Sopranos <vbg! Mark wrote: Dave you are an "expletive deleted" genious! Thank you!! :) "Dave Peterson" wrote: Untested: Option Explicit Sub testme() Dim WorkingFileName As String Dim WorkingLocation As String Dim WorkingDir As String Dim CSVWks As Worksheet Dim LastRow As Long Dim myArray As Variant WorkingDir = "c:\somestring\" WorkingFileName = "master.csv" WorkingLocation = WorkingDir & WorkingFileName If IsFileOpen(WorkingLocation) = True Then MsgBox "The file is in use, wait a moment and try again." Exit Sub Else Set CSVWks = Workbooks.Open(Filename:=WorkingLocation).Workshee ts(1) With CSVWks LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row myArray = .Range("A1:A" & LastRow).Value .Parent.Close savechanges:=False End With Getesc.EscDrop.List = myArray Getesc.Show End If End Sub Mark wrote: I have a combo box that I want to use an array of values from the first column of a CSV file. Workingfilename = "master.csv" workinglocation = workingdir & Workingfilename If IsFileOpen(workinglocation) = True Then MsgBox ("The file is in use, wait a moment and try again.") Exit Sub Else Workbooks.Open (workinglocation) On Error Resume Next a = 1 cnt = 1 Do While Cells(a, 1) < "" a = a + 1 cnt = cnt + 1 Loop Dim myrange As Range Dim myArray() Erase myArray 'incase it's already full myArray = Workbooks("Master.csv").Range(Cells(1, 1), Cells(cnt, 1)).Values Workbooks("Master.csv").Close True Getesc.EscDrop.List = myArray Getesc.Show End If End Sub Any idea why it keeps coming up blank?? -- Dave Peterson -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Populate text box or combo box with external files with links to file names | Links and Linking in Excel | |||
Populate one combo box based on the selection of another combo box | Excel Programming | |||
Populate form combo with unique values | Excel Programming | |||
Populate combo box with unique values only | Excel Discussion (Misc queries) | |||
Populate Combo Box with Text file | Excel Programming |