i need to create a macro that prompts the user to.....

  • Thread starter Thread starter mbos015
  • Start date Start date
M

mbos015

i need to create a macro that prompts the user to select an xls file o
files from the harddrive and then copy the same range from eac
selected xls file (sheet 1) into the same spot on the current workboo
and sheet from where the macro was activiated.

anyone willing to take that on for me. I am mainly interested in how t
prompt the user with an open file prompt and then do stuff to th
opened file or files
 
This will get you started :-

'----------------------------------------
Sub test()
Dim MyFile As String
Dim FromSheet As Worksheet
Dim ToSheet As Worksheet
'---------------------------
Set ToSheet = ActiveSheet
MyFile = Application.GetOpenFilename
If MyFile = "" Then End
Workbooks.Open (MyFile)
'---------------------------
Set FromSheet = ActiveWorkbook.Worksheets("Sheet1")
End Sub
'-----------------------------------------
 
Back
Top