PC Review


Reply
Thread Tools Rate Thread

Adding parenthesis to a formula?

 
 
Danni2004
Guest
Posts: n/a
 
      18th Nov 2008
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!
 
Reply With Quote
 
 
 
 
Bernard Liengme
Guest
Posts: n/a
 
      18th Nov 2008
No, you have to use the ( and ) keys
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Danni2004" <(E-Mail Removed)> wrote in message
news:523C5F8F-801B-4E83-9D31-(E-Mail Removed)...
>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!



 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      18th Nov 2008
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 here:
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
 
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
Formula structure, maybe not parenthesis, CELL()? =?Utf-8?B?bmFzdGVjaA==?= Microsoft Excel Misc 1 25th Sep 2006 07:29 AM
adding a formula including the value another formula gets Dana Microsoft Excel Misc 7 22nd Mar 2006 04:00 PM
formula for parenthesis round negative money values in excel =?Utf-8?B?amVmZg==?= Microsoft Excel Worksheet Functions 1 14th Feb 2006 06:40 AM
Formula Split or parenthesis problem? =?Utf-8?B?bmFzdGVjaA==?= Microsoft Excel Misc 0 16th Jan 2006 12:59 AM
adding parenthesis to values John Microsoft Excel Misc 6 15th Apr 2004 07:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:11 AM.