Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Check if the formula is in a particular format/style

Hi All,

I have a problem or situation. I have excel sheets that have formula
that needs to be changed. I have changed one set and done a copy---
paste special ----- formula. Fine till here.

Now what I want to do is select the range that I have copied the
formula and check if it is in the same format that I require. For
example the formula is say "=If(isblank(A2),"N/A",(C2/E2-D2)).

So, what I need to do is enter the following in a text box :
(if(isblank(xx999),"N/A",(xx999/(xx999-xx999)), where xx represents any
column from A to IV and 999 be a row from 1 to 65536. Is this possible?

Any help will be highly appreciated. Or else i have to check the 27
sheets with 400 formulae in each sheet manually :-(.

Regds

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Check if the formula is in a particular format/style

Not sure exactly what you intend here (why do you want to enter into a
textbox?), but it sounds like you need to be able to find where your formula
is, then to check the formatting and fix it. To cycle through the sheets and
find any cells containing your formula you can do it this way:

Sub FindCells()
Dim ThisSheet as Worksheet, FormulaRange as Range, ThisCell as Range
For Each ThisSheet in ThisWorkbook.Worksheets
Set FormulaRange = ThisSheet.Cells.Cells.SpecialCells(xlCellTypeFormu las)
For Each ThisCell in FormulaRange
If ThisCell.Formula like "=if(isblank(*),"N/A",(*/(*-*))" Then
' set the format
End If
Next ThisCell
Next ThisSheet
End Sub

If you need to set the format to, let's say, numeric with 2 digits after the
decimal point you could do it like this:
ThisCell..NumberFormat = "#0.00"

The If ThisCell.Formula like ... statement may need to be adjusted if you
have similar formulas that this should NOT apply to, but see the VBA help
file on the like operator for details of how you can specify a pattern to
match.

--
- K Dales


"Shuvro Basu" wrote:

Hi All,

I have a problem or situation. I have excel sheets that have formula
that needs to be changed. I have changed one set and done a copy---
paste special ----- formula. Fine till here.

Now what I want to do is select the range that I have copied the
formula and check if it is in the same format that I require. For
example the formula is say "=If(isblank(A2),"N/A",(C2/E2-D2)).

So, what I need to do is enter the following in a text box :
(if(isblank(xx999),"N/A",(xx999/(xx999-xx999)), where xx represents any
column from A to IV and 999 be a row from 1 to 65536. Is this possible?

Any help will be highly appreciated. Or else i have to check the 27
sheets with 400 formulae in each sheet manually :-(.

Regds


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Check if the formula is in a particular format/style

Hi K,

Thank you for your response. I got what I required.

Cheers !!

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
Req help on Formula or vb in excel to calculate between reference style and formula style tia sal2 temp Excel Discussion (Misc queries) 1 September 13th 07 09:02 AM
Req help on Formula or vb in excel to calculate between reference style and formula style tia sal2 temp Excel Worksheet Functions 1 September 13th 07 09:02 AM
Changing from format style to list style B.W. Excel Worksheet Functions 1 November 22nd 06 07:53 PM
can a1 reference style and r1c1 style be used in same formula? rjagga Excel Worksheet Functions 1 September 17th 06 10:58 AM
Check my Conditional Format Formula D[_6_] Excel Programming 3 August 11th 04 05:34 PM


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