reading from another file and pasting to current file, "combobox"

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can anybody please help me know how I can do this:
I have a file lets name it "result.xls" also I have lets say 100 files and
again suppose the names are "aa.xls", "bb.xls", ..., I want to put a combobox
in file, "result.xls" click on that I be able to see the names of those 100
files, then if I select one of them, this copy some data from various cells
in the source file and paste it to specific cells (e.g. B2:F4) in the
"result.xls" file.
Best
Darius
 
Hi Darius,

See if this works for you. This is just an example.

'You need to have combobox, & picturebox.

Const PictDir As String = "C:\" 'change which drive and path you want.

Private Sub ComboBox1_Click()
With Me.ComboBox1
Image1.Picture = LoadPicture(PictDir & ComboBox1.Text)
End With
End Sub

Private Sub UserForm_Activate()
Dim F

F = Dir(PictDir & "*.jpg")

Do While Len(F) > 0
With ComboBox1 'this loads the combo
.AddItem F
End With
F = Dir()
Loop

End Sub
 
Back
Top