Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default CONVERT FORMULA INTO VALUE EXCEPT SUBTOTAL FORMULA

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default CONVERT FORMULA INTO VALUE EXCEPT SUBTOTAL FORMULA

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" wrote in message
oups.com...
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
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
convert vlookup formula to link formula AFA Excel Worksheet Functions 0 February 20th 08 04:24 AM
How to convert a static formula to dynamic formula ? Pisistratus Excel Worksheet Functions 3 July 5th 07 01:54 PM
Excell convert formula row to formula column **Danny** Excel Worksheet Functions 1 January 14th 07 10:03 PM
how to convert a formula into text in order to display the formula Claudio Hartzstein Excel Discussion (Misc queries) 2 July 13th 06 09:58 AM
Convert Normal formula to array formula Pradip Jain Excel Programming 4 May 23rd 05 04:32 PM


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

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

About Us

"It's about Microsoft Excel"