use keyboard to highlight?

bigdan

Well-known Member
Joined
Oct 5, 2009
Messages
846
Office Version
  1. 2013
Platform
  1. Windows
I'm doing a lot of highlighting in this huuuuge file I'm using right now. Is there anyway to access the highlight button by a keyboard shortcut? I've googled this and cant find it.

To be clear, I'm selecting certain cells, and then want to highlight them yellow. At the moment I keep pressing the yellow button on the toolbar via mouse. I just want to hit a keyboard button to do that instead.
 
This would be a prime use of a macro.

Try using the macro recorder, and be sure to set a "Shortcut Key". Then select a cell and highlight it yellow. Then "Stop" the macro recorder.

Go into the VBA editor, and you should see code that looks similar this if you use Excel 2007+:

Code:
Sub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+m
'
    Range("A1").Select
    With Selection.Interior
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
        .Color = 65535
        .TintAndShade = 0
        .PatternTintAndShade = 0
    End With
End Sub
Or this if you use Excel 2003 or older:
Code:
Sub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+m
'
    Range("A1").Select
    With Selection.Interior
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
        .ColorIndex = 6
    End With
End Sub
To allow it to apply to your current selection of cells, just remove the line Range("A1").Select.

Now, when you use your keyboard shortcut combination (which I made ctrl+m in the above example), it should highlight your selected cells with yellow.

Hope this helps!
 
Upvote 0
that did indeed help, thanks! i dont know any vbasic or how to use the editor, however hitting record and stop is easy enough. thanks a lot man :)
 
Upvote 0
I'm selecting certain cells, and then want to highlight them yellow. At the moment I keep pressing the yellow button on the toolbar via mouse.
Is the problem that you are having to select cells (or as contiguous ranges) individually? If so, then you apparently do not know that you can select non-contiguous cells or ranges of cells using the CTRL key while making your selection... then, once you have made your selections, you can click the "yellow button" just one time to color them all at once.
 
Upvote 0
Is the problem that you are having to select cells (or as contiguous ranges) individually? If so, then you apparently do not know that you can select non-contiguous cells or ranges of cells using the CTRL key while making your selection... then, once you have made your selections, you can click the "yellow button" just one time to color them all at once.

no that wasnt the issue. i didnt wnt to click the yellow button at all was the thing. i knew about the control thing. but thanks for verifying.
 
Upvote 0

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