Okay, not asking anything, just giving a tip.
If you're using dir to get filename in a directory, but don't want to get the path in the filename, you can try following:
I'm just get bored for some people asking all the time on how to do thisCode:'we suppoce Directory is a string that contains the directory we want to look for 'add listbox and modify this as you like or make it a function Dim Filename As String If Right(Directory, 1) <> "\" Then Directory = Directory & "\" Filename = Dir(Directory & "*.*", 0) Do While Filename <> "" Filename = Right(Filename, Len(Filename) - Len(Directory) Select Case Filename Case Not ".", Not ".." List1.AddItem Filename End Select Filename = Dir Loop
Hope they're wise enough to pop-up in here today
Add your own tips here if you know usually asked one and if you like to






Reply With Quote