Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 7
Default saving values to cells

ok here goes...

what i was wondering is hard to explain so ill explain it in an small example...

i have 3 sheets in my workbook, 'week1', 'week2' and 'total'

i enter the number 10 in cell A1 on the 'week1' sheet and the number 3 in cell B2 on the 'week2' sheet

on the 'total' sheet in cell C3 i enter the formula =week1!A1+week2!B2 and it adds it obviously.

but i then want to delete sheets 'week1' and 'week2' yet keep the value 13 in cell C3 on the 'total' sheet WITHOUT having to type it in myself.

ignore the macro part i would like to know just how to lock the values to the cells.

is this even possible? im using excel 2000 but have access to 2003 if necessary. any response would be wonderful :)

thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 303
Default saving values to cells

The cell Total!C3 needs to be changed from a formula to a value
select the cell

<cntrC to copy
<altESV to paste special "values"

You can put this into an auto macro
say before save

Say your total is in cell C3 on sheet3
enter the macro below into the workbook code.
To get there ,,,,,,,,right click onto the excel sign next to the "file" menu
on the top menu bar
select view code

select "workbook" in the top left dropdown and "before save" in the right
dropdown


You'll see.............
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
End Sub

Copy the following lines............and paste them between Private
Sub...........and End Sub

Sheet3.Select
Range("C3").Copy
Range("C3").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False

So the end result will be...............

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Sheet3.Select
Range("C3").Copy
Range("C3").PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
End Sub

From now each time you save the workbook the contents of cell C3 will be
copied and pasted
as a value.


--
Greetings from New Zealand

"bouncebackability" wrote in
message ...

ok here goes...

what i was wondering is hard to explain so ill explain it in an small
example...

i have 3 sheets in my workbook, 'week1', 'week2' and 'total'

i enter the number 10 in cell A1 on the 'week1' sheet and the number 3
in cell B2 on the 'week2' sheet

on the 'total' sheet in cell C3 i enter the formula =week1!A1+week2!B2
and it adds it obviously.

but i then want to delete sheets 'week1' and 'week2' yet keep the value
13 in cell C3 on the 'total' sheet WITHOUT having to type it in myself.

ignore the macro part i would like to know just how to lock the values
to the cells.

is this even possible? im using excel 2000 but have access to 2003 if
necessary. any response would be wonderful :)

thanks in advance.




--
bouncebackability



  #3   Report Post  
Posted to microsoft.public.excel.newusers
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default saving values to cells

Copy PasteSpecial Values, will delete the formula and retain the result...

Vaya con Dios,
Chuck, CABGx3



"bouncebackability" wrote:


ok here goes...

what i was wondering is hard to explain so ill explain it in an small
example...

i have 3 sheets in my workbook, 'week1', 'week2' and 'total'

i enter the number 10 in cell A1 on the 'week1' sheet and the number 3
in cell B2 on the 'week2' sheet

on the 'total' sheet in cell C3 i enter the formula =week1!A1+week2!B2
and it adds it obviously.

but i then want to delete sheets 'week1' and 'week2' yet keep the value
13 in cell C3 on the 'total' sheet WITHOUT having to type it in myself.

ignore the macro part i would like to know just how to lock the values
to the cells.

is this even possible? im using excel 2000 but have access to 2003 if
necessary. any response would be wonderful :)

thanks in advance.




--
bouncebackability

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
Filtered cells return after saving Susienak Excel Discussion (Misc queries) 4 November 18th 07 01:40 PM
Saving Values in Excel when using RTD nhench Excel Worksheet Functions 4 April 9th 07 06:44 PM
only saving selected cells from a worksheet Robert Loxley Excel Discussion (Misc queries) 0 November 30th 06 02:21 PM
Saving some cells Bunnis Excel Worksheet Functions 1 June 28th 06 06:21 AM
Saving files with a list of values Sérgio Lopes Excel Discussion (Misc queries) 3 March 28th 06 02:17 PM


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