copy formula when creating new sheet

  • Thread starter Thread starter Guest
  • Start date Start date
using something like this:

Workbooks("newbook.xls").Worksheets("sheet1").Range("a1").Formula =
Workbooks("oldbook.xls").Worksheets("sheet1").Range("a1").Formula
 
Thank you for your clever response. I see that the macro you gave me works
well. However I still have a problem.. The file being created by the software
is an excel file, but I can't seem to make the software input the macro you
gave me. So the file is created and then in order for me to use your macro I
would have to put in afterwards which doesn't suit. I don't know much about
macro's so maybe I'm missing something????
 
Thanks for that. Could you tell me where in the code below were I would
insert your code?

If rsp = 6 Then
DataBaseWks.Rows("1:" & i).Copy Destination:=wks.Range("A1")
'code to remove grid lines
wks.Activate
ActiveWindow.DisplayGridlines = False
Cells(11, 1).Select
ActiveWindow.FreezePanes = True

'code to do column widths
For iCol = 1 To Columns.Count
wks.Columns(iCol).ColumnWidth =
DataBaseWks.Columns(iCol).ColumnWidth
Next iCol
wks.Rows.AutoFit
 
Back
Top