Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Check cell formula

I wanted to clear all the cells which have formula on it.
Are there any function to check this like "Isformula" in VBA?

Any information is great appreciated,



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Check cell formula

Try something like this...

Sheet1.Cells.SpecialCells(xlCellTypeFormulas).Clea rContents

which clears all of the formulas on sheet 1
--
HTH...

Jim Thomlinson


"Souris" wrote:

I wanted to clear all the cells which have formula on it.
Are there any function to check this like "Isformula" in VBA?

Any information is great appreciated,



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Check cell formula

Thanks for the informaiton,
It works, but it fails if there is no formula on the spreadsheet.
Should I check that does spreadsheet have formula before run the code?

Thanks again,


"Jim Thomlinson" wrote:

Try something like this...

Sheet1.Cells.SpecialCells(xlCellTypeFormulas).Clea rContents

which clears all of the formulas on sheet 1
--
HTH...

Jim Thomlinson


"Souris" wrote:

I wanted to clear all the cells which have formula on it.
Are there any function to check this like "Isformula" in VBA?

Any information is great appreciated,



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Check cell formula

Hi Souris,

Whenever using the specialCells method it is advisable to use a
precautionary error handler.



Dim SH As Worksheet
Dim rng As Range

Set SH = Sheets("Sheet1")

On Error Resume Next
Set rng = SH.Cells.SpecialCells(xlFormulas)
On Error GoTo 0

If Not rng Is Nothing Then rng.ClearContents


---
Regards,
Norman



"Souris" wrote in message
...
Thanks for the informaiton,
It works, but it fails if there is no formula on the spreadsheet.
Should I check that does spreadsheet have formula before run the code?

Thanks again,


"Jim Thomlinson" wrote:

Try something like this...

Sheet1.Cells.SpecialCells(xlCellTypeFormulas).Clea rContents

which clears all of the formulas on sheet 1
--
HTH...

Jim Thomlinson


"Souris" wrote:

I wanted to clear all the cells which have formula on it.
Are there any function to check this like "Isformula" in VBA?

Any information is great appreciated,





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Check cell formula

Is it possible to clear all the format like color and font...etc

Thanks millions,

"Norman Jones" wrote:

Hi Souris,

Whenever using the specialCells method it is advisable to use a
precautionary error handler.



Dim SH As Worksheet
Dim rng As Range

Set SH = Sheets("Sheet1")

On Error Resume Next
Set rng = SH.Cells.SpecialCells(xlFormulas)
On Error GoTo 0

If Not rng Is Nothing Then rng.ClearContents


---
Regards,
Norman



"Souris" wrote in message
...
Thanks for the informaiton,
It works, but it fails if there is no formula on the spreadsheet.
Should I check that does spreadsheet have formula before run the code?

Thanks again,


"Jim Thomlinson" wrote:

Try something like this...

Sheet1.Cells.SpecialCells(xlCellTypeFormulas).Clea rContents

which clears all of the formulas on sheet 1
--
HTH...

Jim Thomlinson


"Souris" wrote:

I wanted to clear all the cells which have formula on it.
Are there any function to check this like "Isformula" in VBA?

Any information is great appreciated,








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Check cell formula

Hi Souris,

Is it possible to clear all the format like color and font...etc


Dim SH As Worksheet
Dim rng As Range

Set SH = Sheets("Sheet1")

On Error Resume Next
Set rng = SH.Cells.SpecialCells(xlFormulas)
On Error GoTo 0

If Not rng Is Nothing Then rng.Clear


---
Regards,
Norman



"Souris" wrote in message
...
Is it possible to clear all the format like color and font...etc

Thanks millions,

"Norman Jones" wrote:

Hi Souris,

Whenever using the specialCells method it is advisable to use a
precautionary error handler.



Dim SH As Worksheet
Dim rng As Range

Set SH = Sheets("Sheet1")

On Error Resume Next
Set rng = SH.Cells.SpecialCells(xlFormulas)
On Error GoTo 0

If Not rng Is Nothing Then rng.ClearContents


---
Regards,
Norman



"Souris" wrote in message
...
Thanks for the informaiton,
It works, but it fails if there is no formula on the spreadsheet.
Should I check that does spreadsheet have formula before run the code?

Thanks again,


"Jim Thomlinson" wrote:

Try something like this...

Sheet1.Cells.SpecialCells(xlCellTypeFormulas).Clea rContents

which clears all of the formulas on sheet 1
--
HTH...

Jim Thomlinson


"Souris" wrote:

I wanted to clear all the cells which have formula on it.
Are there any function to check this like "Isformula" in VBA?

Any information is great appreciated,








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
Check if Conditional Format is True or False / Check cell Color Kevin McCartney Excel Worksheet Functions 5 June 29th 07 11:12 AM
formula to check Cell value within specific character TA Excel Discussion (Misc queries) 2 February 12th 07 05:46 PM
How do I check for an empty cell in a formula? sasquatchbill Excel Discussion (Misc queries) 4 August 8th 06 03:55 PM
Check if a cell has a formula. diego.gomes Excel Worksheet Functions 2 May 10th 06 05:40 PM
How to check whether a cell contains a formula or a value Eric Jan van de Veen Excel Worksheet Functions 3 November 25th 04 07:35 PM


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