vba - stop users typing a 'minus sign' as the first character in a cell...

RobbieC

Active Member
Joined
Dec 14, 2016
Messages
376
Office Version
  1. 2010
Platform
  1. Windows
Hi there, I have a spreadsheet for user info entries. This has been working successfully but something has just come to my attention...

If a user enters something into a cell and starts off with a - (minus sign) or = (equals), Excel is expecting some sort of formula to happen and causes an error...

is there a way to detect this and if the first char of any cell (whilst typing) is a - or =, to replace it with a different character?

This would be very helpful if you can point me in the right direction

Thanks
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
What kind of data is being entered into this range?
If it is not numbers or dates that need to be used later in mathematical computations, if you simply format the column as "Text", they will be able to enter those values in and it won't cause Excel any issues.
 
Upvote 0
Ah, that's a great idea Joe... I shall make the appropriate changes

Thanks very much
 
Upvote 0
You are welcome!

BTW, you could do what you originally asked via VBA code, but sometimes the best solutions are the simplest!
;)
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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