Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
clemrogan
 
Posts: n/a
Default Zeroing out data but leaving formulas.

I have a spreadsheet that I calculates monthly data and puts it into a year
end management spreadsheet. How do I clear the cells of data (zero out) but
leave the formulas intact so that I can use the spreadsheet again in the
comming year?
  #2   Report Post  
JR
 
Posts: n/a
Default

You should be able to just delete the static data (the data that the formulas
are using to make calculations). To toggle the formula view (see the
formulas) use Ctrl+~

"clemrogan" wrote:

I have a spreadsheet that I calculates monthly data and puts it into a year
end management spreadsheet. How do I clear the cells of data (zero out) but
leave the formulas intact so that I can use the spreadsheet again in the
comming year?

  #3   Report Post  
Gary''s Student
 
Posts: n/a
Default

First enter this small macro:

Sub keepform()
Dim R As Range
For Each R In Selection
If IsFormula(R) Then
Else
R.Clear
End If
Next
End Sub

Next selection the area in the worksheet you want to clear and run the
macro. The formulae will be left alone and everything else in the area will
be cleared.

-- gsnu001
Gary''s Student


"clemrogan" wrote:

I have a spreadsheet that I calculates monthly data and puts it into a year
end management spreadsheet. How do I clear the cells of data (zero out) but
leave the formulas intact so that I can use the spreadsheet again in the
comming year?

  #4   Report Post  
clemrogan
 
Posts: n/a
Default

Sorry,

This did not work.

Getting "compile error" sub or function not defined
and the IsFormula is highlighted

Also is their any way to apply it to a whole workbook (only the unprotected
cells) with 12 sheets (one for each month of the year) or do I have to go
sheet by sheet?

"Gary''s Student" wrote:

First enter this small macro:

Sub keepform()
Dim R As Range
For Each R In Selection
If IsFormula(R) Then
Else
R.Clear
End If
Next
End Sub

Next selection the area in the worksheet you want to clear and run the
macro. The formulae will be left alone and everything else in the area will
be cleared.

-- gsnu001
Gary''s Student


"clemrogan" wrote:

I have a spreadsheet that I calculates monthly data and puts it into a year
end management spreadsheet. How do I clear the cells of data (zero out) but
leave the formulas intact so that I can use the spreadsheet again in the
comming year?

  #5   Report Post  
JR
 
Posts: n/a
Default

You could just record the macro instead of trying to write it. Start
recording, highlight the cells you want to delete, then press delete. You
can either keep going (on to the next tab) while still recording, or you can
stop, go into the editor and copy & paste what you just recorded, changing
the tab names as you go.

"clemrogan" wrote:

Sorry,

This did not work.

Getting "compile error" sub or function not defined
and the IsFormula is highlighted

Also is their any way to apply it to a whole workbook (only the unprotected
cells) with 12 sheets (one for each month of the year) or do I have to go
sheet by sheet?

"Gary''s Student" wrote:

First enter this small macro:

Sub keepform()
Dim R As Range
For Each R In Selection
If IsFormula(R) Then
Else
R.Clear
End If
Next
End Sub

Next selection the area in the worksheet you want to clear and run the
macro. The formulae will be left alone and everything else in the area will
be cleared.

-- gsnu001
Gary''s Student


"clemrogan" wrote:

I have a spreadsheet that I calculates monthly data and puts it into a year
end management spreadsheet. How do I clear the cells of data (zero out) but
leave the formulas intact so that I can use the spreadsheet again in the
comming year?



  #6   Report Post  
Gary''s Student
 
Posts: n/a
Default

I am sorry. Here is the missing part:

Function IsFormula(cell As Range) As Boolean
IsFormula = cell.HasFormula
End Function

Using this would require a sheet by sheet approach
--
Gary''s Student


"clemrogan" wrote:

Sorry,

This did not work.

Getting "compile error" sub or function not defined
and the IsFormula is highlighted

Also is their any way to apply it to a whole workbook (only the unprotected
cells) with 12 sheets (one for each month of the year) or do I have to go
sheet by sheet?

"Gary''s Student" wrote:

First enter this small macro:

Sub keepform()
Dim R As Range
For Each R In Selection
If IsFormula(R) Then
Else
R.Clear
End If
Next
End Sub

Next selection the area in the worksheet you want to clear and run the
macro. The formulae will be left alone and everything else in the area will
be cleared.

-- gsnu001
Gary''s Student


"clemrogan" wrote:

I have a spreadsheet that I calculates monthly data and puts it into a year
end management spreadsheet. How do I clear the cells of data (zero out) but
leave the formulas intact so that I can use the spreadsheet again in the
comming year?

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
Purge functions leaving only calculated data? kincaid05 Excel Worksheet Functions 2 July 14th 05 05:53 PM
Can Excel recognize when data is entered and apply formulas? cwool4512 Excel Worksheet Functions 2 July 7th 05 07:58 PM
Pasting data without removing formulas rayteach Excel Discussion (Misc queries) 5 May 27th 05 01:00 AM
Line Graph Data Recognition Nat Charts and Charting in Excel 2 April 30th 05 02:07 PM
Formulas in source data Ken Charts and Charting in Excel 3 December 1st 04 05:43 PM


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