PC Review


Reply
Thread Tools Rate Thread

CONVERT FORMULA INTO VALUE EXCEPT SUBTOTAL FORMULA

 
 
shaqil
Guest
Posts: n/a
 
      30th May 2007
Dear All,

Normally I have with many formula but when I forward the file i
convert all formulas with their values (with the help of Paste
Special) but I want to replace all formulas with values except
subtotal & sum formulas.

Can anyone help me.

Thnx in advance.

 
Reply With Quote
 
 
 
 
Norman Jones
Guest
Posts: n/a
 
      30th May 2007
Hi Shaqil,

Try something like:

'============>>
Public Sub Tester001()
Dim WB As Workbook
Dim SH As Worksheet
Dim Rng As Range
Dim rCell As Range

Set WB = Workbooks("MyBook1.xls") '<<==== CHANGE
Set SH = WB.Sheets("Sheet1") '<<==== CHANGE

On Error Resume Next
Set Rng = SH.Cells.SpecialCells(xlCellTypeFormulas)
On Error GoTo 0

If Not Rng Is Nothing Then
For Each rCell In Rng.Cells
With rCell
If InStr(1, .Formula, "Sum", vbTextCompare) = 0 _
And InStr(1, .Formula, "SubTotal", _
vbTextCompare) = 0 Then
.Value = .Value
End If
End With
Next rCell
End If
End Sub
'<<============


---
Regards,
Norman



"shaqil" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Dear All,
>
> Normally I have with many formula but when I forward the file i
> convert all formulas with their values (with the help of Paste
> Special) but I want to replace all formulas with values except
> subtotal & sum formulas.
>
> Can anyone help me.
>
> Thnx in advance.
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Excel formula to Access Query formula SJW_OST Microsoft Access Queries 6 29th May 2008 07:55 PM
convert vlookup formula to link formula AFA Microsoft Excel Worksheet Functions 0 20th Feb 2008 04:24 AM
How to convert a static formula to dynamic formula ? =?Utf-8?B?UGlzaXN0cmF0dXM=?= Microsoft Excel Worksheet Functions 3 5th Jul 2007 01:54 PM
Excell convert formula row to formula column =?Utf-8?B?KipEYW5ueSoq?= Microsoft Excel Worksheet Functions 1 14th Jan 2007 10:03 PM
how to convert a formula into text in order to display the formula =?Utf-8?B?Q2xhdWRpbyBIYXJ0enN0ZWlu?= Microsoft Excel Misc 2 13th Jul 2006 09:58 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:41 PM.