Thread: Creating Report
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
brownti via OfficeKB.com brownti via OfficeKB.com is offline
external usenet poster
 
Posts: 103
Default Creating Report

I am trying to create a macro that will create a report from the current open
file. i want it to create a new workbook and save it as the contents of a
cell in the current workbook. Here is the very rough beginings of the macro,
but i dont know how to get it to do what i want.

Sub report()
Workbooks.Add
ChDir "C:\Documents and Settings\tim\Desktop"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\tim\Desktop\Book1.xls", FileFormat:
=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
Range("B4").Select
ActiveCell.FormulaR1C1 = "=[Book2]Sheet1!R1C1"
Range("B5").Select
End Sub

--
Message posted via http://www.officekb.com