View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
sowetoddid[_7_] sowetoddid[_7_] is offline
external usenet poster
 
Posts: 1
Default Macro command to open a file

Trying to learn this,
I should input my specific names as...

Sub testIt()
Dim ThisWB As Workbook, OpenedWB As Workbook, _
OpenFileName As Variant
Set ThisWB = ThisWorkbook
OpenFileName = Application.GetOpenFilename()
If LCase(TypeName(OpenFileName)) = "boolean" Then
Else
Set OpenedWB = Workbooks.Open(OpenFileName)
OpenedWB.Sheets(1).Range("A1:Z100").Copy
ThisWB.Worksheets("music").Range("b1").PasteSpecia l _
xlPasteValuesAndNumberFormats
OpenedWB.Close False
End If
End Sub


And in the other example...

Set oWB = Activeworkbook
"Master File"((Range("A1")).Open
Music.Range("A1:Z100").Copy
Destination:=oWB.ACtivesheet.Range("B1")
Activeworkbook.Close
oWB.ACtivate


Please correct me. Also. Any suggestions for a good source o
learning this? I have seen some downloadable help a
Add-ins.com.....Any experience with that?

Many thanks

--
Message posted from http://www.ExcelForum.com