LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 179
Default EXCEL USERFORM

Gary

Here's a sub in the Initialize event that will find all the jpg's in a
folder and list them on your userform.

Private Sub UserForm_Initialize()

Dim Fldr As String
Dim FName As String
Dim i As Long
Dim cnt As Control

Fldr = "C:\My Documents\My Pictures\"

FName = Dir(Fldr & "*.jpg")
i = 10

Do While Len(FName) 0
Set cnt = Me.Controls.Add("forms.checkbox.1", , True)
cnt.Top = i
cnt.Left = 10

Set cnt = Me.Controls.Add("forms.label.1", , True)
cnt.Top = i
cnt.Left = 30
cnt.Caption = FName

i = i + 30
FName = Dir
Loop

End Sub

--
Dick Kusleika
MVP - Excel
www.dicks-clicks.com
Post all replies to the newsgroup.

"Gary Burke" wrote in message
...
Hi there,

Have a desire/need to populate a userform (continuous form ??) with a
list of files from a folder (of a selected type only - pictures), and
provide the facility to search other folders, so am guessing that i
would list the selected files(of a given type) and folders. I know I
could use the interface to windows, to activate the windows "Open File"
dialogue box, but dont to do that.

I would also like to have on the form, a check box, against each file
listed, so the user may "select" the file they wish to use. Propose
adding an "execute" button, to do something with the file once selected.
This will be to insert the picture into a designated area on the excel
worksheet, and to resize it.




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



 
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
Automatic Userform Excel 2003 BJ&theBear Excel Discussion (Misc queries) 2 March 16th 10 08:58 PM
VBA with userform in excel [email protected] Excel Discussion (Misc queries) 5 July 11th 07 11:24 PM
display status bar value in excel userform? Al B Excel Discussion (Misc queries) 0 November 15th 06 01:21 PM
Userform in excel ST Excel Discussion (Misc queries) 2 July 13th 06 10:16 AM


All times are GMT +1. The time now is 04:50 PM.

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

About Us

"It's about Microsoft Excel"