#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving Data

I have triied to use the following code to save entered data. Howeve
it also deletes all the formulas in cells not used yet. I'm triing t
save data as it is entered. Once the data is entered the formula i
not need for that cell. However, future data is depended on th
formula in other cells not used yet. ??????


Sheet2.Activate
Set rng = Range("A3:E366")
If rng 0 Then
rng.Formula = rng.Value
Else
rng.Formula = rng.Formula
End If


Thank you again

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving Data

You could try Activesheet.Save....i'm pretty new to this so dont kno
how it would work but for it to work when a change is made on a shee
it would have to e in Private Sub Worksheet_sheetselection_change.

HTH

SImo

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Saving Data

ceplane

Sheets("Sheet6").Activate
Set rng = Range("A3:E366")
For Each rcel In rng
If rcel.Value 0 Then
rcel.Formula = rcel.Value
Else
rcel.Formula = rcel.Formula
End If
Next rcel


Gord Dibben Excel MVP


On Mon, 10 May 2004 14:10:24 -0500, ceplane
wrote:

I have triied to use the following code to save entered data. However
it also deletes all the formulas in cells not used yet. I'm triing to
save data as it is entered. Once the data is entered the formula is
not need for that cell. However, future data is depended on the
formula in other cells not used yet. ??????


Sheet2.Activate
Set rng = Range("A3:E366")
If rng 0 Then
rng.Formula = rng.Value
Else
rng.Formula = rng.Formula
End If


Thank you again.


---
Message posted from http://www.ExcelForum.com/


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving Data

Thank you for the ideas.
But, she hangs up on

If rcel.Value 0 Then

Doesn't look much different then what I triied before.
Sounds simple I can't get it to work.

The active sheet save didn't work either. ?????

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Saving Data

What is "hangs up"?

Looks much different from your original code and changes formulas to values if
they return something. Leaves formulas as is if they return nothing.

As far as saving the Activesheet, I don't see that anywhere in your original
code.

Here is a simple Macro for saving the active worksheet
with the sheet name as the file name.

Sub SaveSheet()
ActiveSheet.Copy
ActiveWorkbook.SaveAs Filename:=ActiveSheet.Name, _
FileFormat:=xlNormal
End Sub

Gord



On Mon, 10 May 2004 20:33:49 -0500, ceplane
wrote:

Thank you for the ideas.
But, she hangs up on

If rcel.Value 0 Then

Doesn't look much different then what I triied before.
Sounds simple I can't get it to work.

The active sheet save didn't work either. ??????


---
Message posted from http://www.ExcelForum.com/




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Saving Data

Gord,
When the program runs, I get an error message "Runtime Error 13 Typ
mismatch" and this line is highlighted.

If rcel.Value 0 Then

I don't know if it is the cell format that is causing the problem o
not.

Thanks for your support.
Ric

--
Message posted from http://www.ExcelForum.com

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
Saving data Sidney Excel Discussion (Misc queries) 0 February 25th 10 02:10 PM
Saving data Formula help Excel Discussion (Misc queries) 2 July 26th 09 04:40 AM
saving data? Rhea Excel Discussion (Misc queries) 3 July 22nd 09 02:36 PM
Saving data PennsyNut New Users to Excel 3 November 5th 07 11:41 PM
Saving Data puppynanee Excel Discussion (Misc queries) 0 March 29th 06 09:32 PM


All times are GMT +1. The time now is 05:37 AM.

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

About Us

"It's about Microsoft Excel"