View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
nir020 nir020 is offline
external usenet poster
 
Posts: 31
Default Reading from a file

I am trying to create a macro which when run in excel sheet, use
GetOpenFilename method to reads a selection of cells from another excel sheet
into a selection of cells within that spreadsheet.

I used the following syntax but it does seem to work (where proj blank
basics is the name oif the sheet)

Any ideas?

filename = Application.GetOpenFilename()
MsgBox filename
If filename = False Then
MsgBox "No file was selected"
Exit Sub
End If
Range("B2").Select
ActiveCell.FormulaR1C1 = _
"='" & filename & "]Proj Plan Basics'!R7C1"