Fill combox box from text file
I use the following code to store one name. I would like to store multiple
user entered names and have them usable in a combo box on a quote worksheet.
can someone please help.
Sub SMan()
On Error GoTo ErrorHandler
One:
Open "c:\Program Files\Toyota Quotemaster\Sman.txt" For Input As #1
Input #1, X
Close #1
X = X
Two:
Sheets(1).Range("SMan").Value = X
Open "c:\Program Files\Toyota Quotemaster\Sman.txt" For Output As #1
Write #1, X
Close #1
Exit Sub
ErrorHandler:
Select Case Err.Number
Case 53 'If Counter file does not exist...
X = InputBox("Enter Salesperson's Name to appear on Quotes",
"Create 'Name' File")
Resume Two
Case Else
Resume Next
End Select
End Sub
Sub ChangeSman()
On Error Resume Next
Kill "C:\Program Files\Toyota Quotemaster\Sman.txt"
SMan
ChangeSalesTitle
End Sub
--
AJM1949
|