Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following button code - how can I modify it so only a single .cvs
file can be chosen? Private Sub btnETran_Click() Dim lngCount As Long ' Open the file dialog With Application.FileDialog(msoFileDialogOpen) .AllowMultiSelect = False .Show ' Display paths of each file selected For lngCount = 1 MsgBox .SelectedItems(lngCount) Next lngCount End With End Sub Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub btnETran_Click()
Dim lngCount As Long ' Open the file dialog With Application.FileDialog(msoFileDialogOpen) .Filters.Add "Text files", "*.txt; *.ini; *.bat", 1 .AllowMultiSelect = False .Show ' Display paths of each file selected For lngCount = 1 To 1 MsgBox .SelectedItems(lngCount) Next lngCount End With End Sub To find this out just use the Object browser. If you look in the list on the left you will see the FileDialog class with on the right all the members. One of them is Filters. Right-click Filters and look in the help. RBS "MervB" wrote in message ... I have the following button code - how can I modify it so only a single .cvs file can be chosen? Private Sub btnETran_Click() Dim lngCount As Long ' Open the file dialog With Application.FileDialog(msoFileDialogOpen) .AllowMultiSelect = False .Show ' Display paths of each file selected For lngCount = 1 MsgBox .SelectedItems(lngCount) Next lngCount End With End Sub Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
select file from which to extract specific data | Excel Discussion (Misc queries) | |||
I cannot select any options or type any data | Excel Discussion (Misc queries) | |||
can i type a number for a specific name to appear in the cell? | Excel Discussion (Misc queries) | |||
Select rows and sort based on type | Excel Discussion (Misc queries) | |||
Auto Select a file not knowing its specific name | Excel Programming |