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

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
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,215,335
Messages
6,124,327
Members
449,155
Latest member
ravioli44

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