Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Filename and creation timestamp in 2-column combobox

Thank you, Shah.

Larry

"Shailesh Shah" wrote in message
...
Hi,

Another method to try,

Example from VBA Help & modified.

Private Sub UserForm_Initialize()
Dim mypath, myname

mypath = "c:\windows\" ' Set the path.
myname = Dir(mypath, vbDirectory) ' Retrieve the first entry.
With Me.ComboBox1
Do While myname < "" ' Start the loop.
' Ignore the current directory and the encompassing
directory.
If myname < "." And myname < ".." Then
' Use bitwise comparison to make sure MyName is a Fileanme

If (GetAttr(mypath & myname) And vbDirectory) <
vbDirectory Then

'Debug.Print MyName ' Display entry only if it
represents a filename
If UCase(Right(myname, 4)) = ".TXT" Then
.ColumnCount = 2
.AddItem myname
.List(.ListCount - 1, 1) = FileDateTime(mypath &
myname)
End If
End If
End If
myname = Dir ' Get next entry.
Loop
If .ListCount 0 Then .ListIndex = 0
End With
End Sub



Regards,
Shah Shailesh
http://members.lycos.co.uk/shahweb/


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004


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
Excel VBA Multi Column ComboBox jlclyde Excel Discussion (Misc queries) 3 October 15th 09 04:21 PM
text parsing/table creation from single column data cruiser Excel Discussion (Misc queries) 1 October 24th 07 12:19 PM
Pivot table column creation: Mission Impossible ? mrchong Excel Discussion (Misc queries) 7 April 19th 06 04:41 PM
Show Filename Only in ComboBox Pulldown D.Parker Excel Discussion (Misc queries) 16 June 29th 05 02:46 PM
Multiple Column ComboBox using Additem Jimmi Excel Programming 2 September 24th 03 02:40 AM


All times are GMT +1. The time now is 03:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"