Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 74
Default is there a way to change a formula to a value

is there a way to change a cell's contents, upon saving the file, from a
formula to a value. or as soon as the file has opened.
thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default is there a way to change a formula to a value

Put this event macro in the workbook code area:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
With Sheets("Sheet3").Range("A1")
..Value = .Value
End With
End Sub

It replaces the formula in cell A1 in sheet Sheet3 with its value.

--
Gary''s Student - gsnu200786


"des-sa" wrote:

is there a way to change a cell's contents, upon saving the file, from a
formula to a value. or as soon as the file has opened.
thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default is there a way to change a formula to a value

On May 14, 7:54 am, des-sa wrote:
is there a way to change a cell's contents, upon saving the file, from a
formula to a value. or as soon as the file has opened.
thanks


You do a copy, then Paste Special. The keyboard shortcuts are
Ctrl - C
Alt- E, S V, Enter, Esc
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default is there a way to change a formula to a value

With Workbook event code, either BeforeSave or Workbook_Open.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
With Sheets("Sheet1").Range("A10")
..Value = .Value
End With
End Sub


Gord Dibben MS Excel MVP

On Wed, 14 May 2008 07:54:02 -0700, des-sa
wrote:

is there a way to change a cell's contents, upon saving the file, from a
formula to a value. or as soon as the file has opened.
thanks


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 74
Default is there a way to change a formula to a value

thank you Gord - works 100%

can i now push my luck. i have 2 buttons, each with a macro attached to it.
one for saving the file with the date and document number as file name, the
other to print the document.

could it not be possible to have a macro or vba script attached to a single
button which, when pressed, print 2 copies of the document, saves the
document and closes it.

"Gord Dibben" wrote:

With Workbook event code, either BeforeSave or Workbook_Open.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
With Sheets("Sheet1").Range("A10")
..Value = .Value
End With
End Sub


Gord Dibben MS Excel MVP

On Wed, 14 May 2008 07:54:02 -0700, des-sa
wrote:

is there a way to change a cell's contents, upon saving the file, from a
formula to a value. or as soon as the file has opened.
thanks





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 74
Default is there a way to change a formula to a value

pushing even further - and maybe opens the template again for the new quote

"Gord Dibben" wrote:

With Workbook event code, either BeforeSave or Workbook_Open.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
With Sheets("Sheet1").Range("A10")
..Value = .Value
End With
End Sub


Gord Dibben MS Excel MVP

On Wed, 14 May 2008 07:54:02 -0700, des-sa
wrote:

is there a way to change a cell's contents, upon saving the file, from a
formula to a value. or as soon as the file has opened.
thanks



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default is there a way to change a formula to a value

You would need to combine your two macros into one and add a couple of lines

Sheets("Sheet1").PrintOut Copies:=2
Workbooks.Add Template:="your path to the Template"

' your code to Save and close the first workbook


Gord

On Wed, 14 May 2008 09:20:01 -0700, des-sa
wrote:

pushing even further - and maybe opens the template again for the new quote

"Gord Dibben" wrote:

With Workbook event code, either BeforeSave or Workbook_Open.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
With Sheets("Sheet1").Range("A10")
..Value = .Value
End With
End Sub


Gord Dibben MS Excel MVP

On Wed, 14 May 2008 07:54:02 -0700, des-sa
wrote:

is there a way to change a cell's contents, upon saving the file, from a
formula to a value. or as soon as the file has opened.
thanks




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
change color of all cells with formula or are part of a formula [email protected] Excel Discussion (Misc queries) 19 January 28th 08 01:21 AM
copy formula down a column and have cell references change within formula brad New Users to Excel 5 May 13th 07 04:38 PM
Tex Formula Does not change. Rao Ratan Singh Excel Discussion (Misc queries) 7 April 12th 07 06:36 AM
want to copy formula, only change one number in formula cac1966 Excel Worksheet Functions 3 March 12th 07 10:39 PM
How does Data Validation change with a formula change? MayClarkOriginals Excel Worksheet Functions 3 July 5th 06 04:50 AM


All times are GMT +1. The time now is 01:07 PM.

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"