Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
ASU ASU is offline
external usenet poster
 
Posts: 63
Default copy formula when creating new sheet

How can I copy and paste formulas, using vb codes, when creating a new
spreadsheet.
--
ASU
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 341
Default copy formula when creating new sheet

using something like this:

Workbooks("newbook.xls").Worksheets("sheet1").Rang e("a1").Formula =
Workbooks("oldbook.xls").Worksheets("sheet1").Rang e("a1").Formula
--
Allllen


"ASU" wrote:

How can I copy and paste formulas, using vb codes, when creating a new
spreadsheet.
--
ASU

  #3   Report Post  
Posted to microsoft.public.excel.misc
ASU ASU is offline
external usenet poster
 
Posts: 63
Default copy formula when creating new sheet

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
--
ASU


"Allllen" wrote:

using something like this:

Workbooks("newbook.xls").Worksheets("sheet1").Rang e("a1").Formula =
Workbooks("oldbook.xls").Worksheets("sheet1").Rang e("a1").Formula
--
Allllen


"ASU" wrote:

How can I copy and paste formulas, using vb codes, when creating a new
spreadsheet.
--
ASU

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default copy formula when creating new sheet

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????



"ASU" wrote:

How can I copy and paste formulas, using vb codes, when creating a new
spreadsheet.
--
ASU

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro unouwanme Excel Discussion (Misc queries) 9 August 31st 06 09:38 PM
Copy a relative reference formula from one sheet to another. jannkatt Excel Discussion (Misc queries) 3 May 17th 06 07:13 PM
Copy Formula That References Another Sheet JR573PUTT Excel Discussion (Misc queries) 9 February 16th 06 10:24 PM
Copy sheet - Break Links to Old Workbook - Retain Formula. Mr Anonymouse Setting up and Configuration of Excel 1 October 15th 05 01:00 AM
how do I copy info from one sheet to another via a formula? Trese Excel Worksheet Functions 6 July 28th 05 02:55 PM


All times are GMT +1. The time now is 04:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"