Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Problem copying formulas using VB

I'm using the below line in my code to copy sheet with fairly complex
formulas to a new sheet. The formulas in the original sheet are feed from a
data set A the new sheet is feed by a dataset B.

Worksheets("A").Cells.Copy Destination:=Worksheets("B").Cells(1, 1)

Most of the time this works fine without problems but at times some users
report that instead of the formulas the cell content copies as values. In
other words the sheet looks the way you expect (including the formating) but
the cells don't have formulas anymore and contain the values from the
original sheet. I have also seen this with varations of the below code. (i.e.
..Paste).

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Problem copying formulas using VB

Hi

Use PasteSpecial to paste formulas.
Try this:

Worksheets("A").Cells.Copy
Worksheets ("B"), Cells(1, 1), PasteSpecial(Paste:=xlPasteFormulas)

HTH
Per

"Felix" skrev i meddelelsen
...
I'm using the below line in my code to copy sheet with fairly complex
formulas to a new sheet. The formulas in the original sheet are feed from
a
data set A the new sheet is feed by a dataset B.

Worksheets("A").Cells.Copy Destination:=Worksheets("B").Cells(1, 1)

Most of the time this works fine without problems but at times some users
report that instead of the formulas the cell content copies as values. In
other words the sheet looks the way you expect (including the formating)
but
the cells don't have formulas anymore and contain the values from the
original sheet. I have also seen this with varations of the below code.
(i.e.
.Paste).


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Problem copying formulas using VB

Thanks, I'll try and see if it is more robust.

"Per Jessen" wrote:

Hi

Use PasteSpecial to paste formulas.
Try this:

Worksheets("A").Cells.Copy
Worksheets ("B"), Cells(1, 1), PasteSpecial(Paste:=xlPasteFormulas)

HTH
Per

"Felix" skrev i meddelelsen
...
I'm using the below line in my code to copy sheet with fairly complex
formulas to a new sheet. The formulas in the original sheet are feed from
a
data set A the new sheet is feed by a dataset B.

Worksheets("A").Cells.Copy Destination:=Worksheets("B").Cells(1, 1)

Most of the time this works fine without problems but at times some users
report that instead of the formulas the cell content copies as values. In
other words the sheet looks the way you expect (including the formating)
but
the cells don't have formulas anymore and contain the values from the
original sheet. I have also seen this with varations of the below code.
(i.e.
.Paste).



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
problem copying formulas Dan in Anchorage Excel Discussion (Misc queries) 1 February 17th 09 07:55 PM
COPYING FORMULAS Etg-Para[_2_] Excel Worksheet Functions 3 October 9th 08 09:05 PM
Copying formulas DaveAsh Excel Worksheet Functions 2 November 14th 07 12:38 AM
Copying formulas - problem with the sum dac Excel Worksheet Functions 1 August 3rd 07 03:52 PM
copying formulas in vba Michael Excel Discussion (Misc queries) 1 November 17th 05 08:48 PM


All times are GMT +1. The time now is 09:00 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"