Conditional Question

L

Legacy 5596

Guest
Using the Conditional formating, I'd like to look at the first number in cell A2 and if that number begins with a 9 I'd like to format the cell as TEXT, otherwise leave it general. -- Can this be done?
(no VB please)
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Ok thanks. I didn't see anything like that in there, but I wanted to ask the gurus :)
 
Upvote 0
Of course you could always define a formula to reformat your data in another column...

=IF(LEFT(A2)="9",TEXT(A2,"0"),A2)
 
Upvote 0
If you're willing to give VBA a shot, right-click on the sheet tab, select view code and copy and paste in the following: -
<pre>
Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Count > 1 Then Exit Sub
If Left(Target, 1) = "9" Then
Target.NumberFormat = "@"
Else:
Target.NumberFormat = "General"
End If

End Sub
</pre>
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,393
Members
449,081
Latest member
JAMES KECULAH

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