Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50199

Maintain Formatting when Pasting Data into a Cell with Data Validation

$
0
0
I have a number of cells/columns formatted to two decimal places where I've set the Data Validation to 'Decimal' so that the user can only enter a number, either as e.g. 12, which will display as 12.00 or say 34.6512113 which will display as 34.65. The sheet is protected.

The problem I have is finding a way to maintain the formatting should the user copy and paste data into the cells, e.g. if the user copies and pastes say 12, this appears as 12 in the cell rather than 12.00. Is there any way for pasted data to maintain the correct cell format, which in this case is decimal to two decimal places and likewise to force the Data Validation which I've set up should the user attempt to paste anything other than numbers. At the moment it is perfectly possible to paste letters, despite the data validation.

I appreciate I could remove the option for the user to paste into the cells at all but that isn't a practical option in this instnace and could lead to numerous user errors should the user have to re key data.

Many thanks

Viewing all articles
Browse latest Browse all 50199

Trending Articles