If text in cell is bold then ......

alkarkar

Board Regular
Joined
Sep 18, 2005
Messages
125
Hi everyone.
In every cell A1,A2,A3...A100 there is text (one or two words) which is/are bold or not.
I need to run a macro (or formula?) which will put in B1 the number 1 if text in A1 is bold or else to put number 2, in B2 the number 1 if text in A2 is bold or else to put number 2 .......... in B100 the number 1 if text in A100 is bold or else to put number 2 .
---A---------B-------
TREE-------1
GRASS----1
OCEAN-----2
CHILD-----1

Thanks Alex
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Geia sou Alex,

Try this at a VBA standard module:
Code:
Sub test()
lastrow = Range("a65536").End(xlUp).Row
For i = 1 To lastrow
    If Cells(i, 1).Font.Bold = True Then
        Cells(i, 2) = 1
    Else: Cells(i, 2) = 2
    End If
Next i
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,913
Members
449,093
Latest member
dbomb1414

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