LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Adding parenthesis to a formula?

You could use a macro.

Option Explicit
Sub testme()

Dim myCell As Range
Dim myRng As Range

Set myRng = Nothing
On Error Resume Next
Set myRng = Intersect(Selection, _
Selection.Cells.SpecialCells(xlCellTypeFormulas))
On Error GoTo 0

If myRng Is Nothing Then
MsgBox "Please select some cells with formulas!"
Exit Sub
End If

For Each myCell In myRng.Cells
With myCell
.Formula = "=(" & Mid(.Formula, 2) & ")"
End With
Next myCell
End Sub

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

Danni2004 wrote:

I know that you can toggle the cell references of a formula by highlighting
the set and hitting the F4 button.
A2:B38
$A$2:$B$38
A$2:B$38

But is there a way to highlight a set and place parenthesis around it?
For example,
Go from -- =$A$7/$B$29 to -- =($A$7/$B$29)

Thanks!


--

Dave Peterson
 
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
parenthesis puiuluipui Excel Discussion (Misc queries) 2 May 27th 08 01:59 PM
Formula structure, maybe not parenthesis, CELL()? nastech Excel Discussion (Misc queries) 1 September 25th 06 07:29 AM
WHAT ARE PARENTHESIS IN FORMULAS? ann New Users to Excel 2 August 21st 06 10:43 PM
formula for parenthesis round negative money values in excel jeff Excel Worksheet Functions 1 February 14th 06 06:40 AM
Formula Split or parenthesis problem? nastech Excel Discussion (Misc queries) 0 January 16th 06 12:59 AM


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