Bold on cell click, one cell only

bmpreston

Board Regular
Joined
Jun 18, 2016
Messages
120
Office Version
  1. 365
Platform
  1. MacOS
I have a spreadsheet with a questions in column A. Yes in B, No in C and for some questions, in D a N/A

I’m looking for a VBA that will allow you to click the Yes, No, or N/A per row and bold that text.
I’d also like to validate that if one of the other answers is already bold, it removes the boldface while selecting the new bold.

any ideas?
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Try this Worksheet_SelectionChange event code. Post back if you need help with how to implement it.

VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  If Not Intersect(ActiveCell, Columns("B:D"), Rows("2:" & Rows.Count)) Is Nothing Then
    Intersect(ActiveCell.EntireRow, Columns("B:D")).Font.Bold = False
    ActiveCell.Font.Bold = True
  End If
End Sub
 
Upvote 0
Solution
Yeah, I put it in the ThisWorkbook and I'm unable to have it auto change the cell based on cell click and cell selection.

Thanks
 
Upvote 0
I put it in the ThisWorkbook
It needs to go in the module of the sheet that it is to work on. Right click that sheet's name tab and choose "View Code". Where that opens the vba window is where the code goes.
For example, in my workbook the worksheet in question is named 'Bold'

1612761480783.png
 
Upvote 0
You're welcome. Glad we could help. :)

BTW,
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

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