hi all,
I have a problem that may not look very difficult to you, but I have no experience in vba-programming - so I would appreciate any hints !
I have an open workbook and I programmed a button that opens the open file dialog. What I want to do now is the following: I want to choose an existing .xls-file there, open it, select and copy a certain range, close the .xls-file and paste the stuff I copied at a certain place in the workbook where the button is ... all by clicking the button, chosing a .xls-file and confirming the choice.
well, here is what I have so far:
Private Sub CommandButton1_Click()
Dim F As Variant
Dim Myfolder As String
Myfolder = "C:\home\pok\Tools\Data\"
ChDrive Myfolder
ChDir Myfolder
F = Application.GetOpenFilename("XL Files (*.xls*), *.XL*")
If F = False Then Exit Sub
Workbooks.Open F
end sub
hope the explanation is not too confusing,
thank you very much for your help,
cheers
h.
Bookmarks