add = sign before number

annadinesh

Board Regular
Joined
Mar 1, 2017
Messages
105
dear sir,

sometime we put the following in a cell forgetting using = sign and gets an error or no result

25+35+66+66

i want a vba that automatically add = sign before the numbers

like =25+35+66+66

so that its show the added value


thank you
 
Last edited:

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
This works for all new cells. Do you need one to check all current cells too?

Caution though. whenever you use a "+" in a cell it will add an = to the start. If there are instances where you won't want that then it may need a re-think

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If InStr(1, Target, "+") > 0 And Left(Target, 1) <> "=" Then
        Target = "=" & Target
    End If
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,199
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top