Documente Academic
Documente Profesional
Documente Cultură
TheSmallman.com
(/)
an XL ideas Lab
Search
(/)
Home (/) Courses Models (/Models/) Native Excel (/Native-Excel/) Charts (/Charts/) Dashboards (/Dashboards/)
Infographics (/Infographics/) Modelling (/Modelling/) VBA (/Vba/) Blog (/Blog/) About (/About/)
Something di erent on theSmallman today - actually something di erent all together. Since starting my Excel website and subsequent blog over 3
and a half years ago I have created over 300 pages from nancial modelling to dashboard design to unlocking Excel's scripting dictionary. I have
writen every word myself and have drawn extensively on my posts on Ozgrid and Chandoo forums. Today for the rst time someone else is going
to do the instructing. The two handsome gentleman above are Kasper and Mikel. They came to my attention through a Linkedin feed from
Modelo , the nancial modelling world championships. They hail from Denmark - a place Australians feel a close connection with as one of our
own is due to become Queen of Denmark one day. Kasper and Mikel have created an Excel blog which draws on their passion and knowledge of
Microsoft Excel.
On Spreadsheeto - these gentleman have a bold ambition - "create the best information about Excel you have ever read." While this is an
ambitious exercise, the guys have made a very strong start, posting countless useful blog posts on all things Excel. I wish them every success as
they build their brand and Excel consulting business.
In this article and examples, I use Excel 2016 for Windows, but this method is also usable for you if you are running Excel 2007/2010/2013.
Highlighting rows with conditional formatting in itself is not di cult. It is the automatic part that is tricky. Check out this guide to conditional
formatting if you are not up to speed with the fundamentals.
First, select all continuous data by selecting a cell in your data and using the shortcut ‘Ctrl + A’. In the project le, the selected range is A1:E55.
https://www.thesmallman.com/blog/2016/9/15/auto-highlight-the-active-row-when-a-cell-is-selected 1/6
10/22/2018 Auto-Highlight the Active Row When a Cell is Selected — Excel Dashboards VBA and more
Then, click the ‘Conditional Formatting’-button on the ‘Home’ tab in the ribbon.
Click ‘New Rule’ and in the following dialog box choose ‘Use a formula to determine which cells to format’.
=OR(CELL("row")=CELL("row",A1))
The last argument of the second ‘CELL’-function (the A1) must be the top left cell of the selected data (from before you clicked the ‘Conditional
Formatting’ button).
Customize your format by clicking the ‘Format…’ button in the ‘New Formatting Rule’ dialog box.
From the tabs at the top of the dialog box, choose which kind of formatting you want to apply. For this example, I have chosen a yellow ll for the
cells in the row. Then click ‘OK’.
Option Explicit
https://www.thesmallman.com/blog/2016/9/15/auto-highlight-the-active-row-when-a-cell-is-selected 2/6
10/22/2018 Auto-Highlight the Active Row When a Cell is Selected — Excel Dashboards VBA and more
This code goes not in a normal module, but in the code belonging to a speci c worksheet. Use the shortcut ‘Alt + F11’ to get to the ‘VBA editor’.
Double click ‘Sheet2(Employees)’ in the ‘Project Explorer’ and paste the code from above. If your ‘Project Explorer’ (the menu to the left) is missing
and it does not look like the screenshot on your computer, you need to toggle on the ‘Project Explorer’. Click ‘View’ in the menu and click ‘Project
Explorer’.
Conclution
There you have it. Setting this up is quite easy and quick to do, but adds a nice touch to the system you have created if it holds data in a database
form. Test it out for yourself.
If you haven’t downloaded the project le, be sure to save your work as a macro-enabled workbook (The le type ending with .xlsm).
Tags Excel (/blog/?tag=Excel), Autohighlight (/blog/?tag=Autohighlight), Auto (/blog/?tag=Auto), highlight (/blog/?tag=highlight), Active (/blog/?tag=Active),
Row (/blog/?tag=Row), cell (/blog/?tag=cell), selected (/blog/?tag=selected)
Share 8 Likes
← Advanced Filter a List Automatically (/blog/2016/9/15/advanced- lter-a-l… Water Statistics Infographic in Excel → (/blog/2016/9/15/water-statistics-in…
Featured Posts
Recent Posts
Protect a Worksheet, Use the Auto lter (/blog/2018/10/18/protect-a-worksheet-but-use-the-auto lter) October 18, 2018
https://www.thesmallman.com/blog/2016/9/15/auto-highlight-the-active-row-when-a-cell-is-selected 3/6
10/22/2018 Auto-Highlight the Active Row When a Cell is Selected — Excel Dashboards VBA and more
(/blog/2018/5/19/power-bi-desktop-dashboard)
(/blog/2018/8/1/new-excel-dashboard-tools)
(/blog/2018/6/17/watch-this-space)
(/blog/2018/6/3/the-fuzzy-world-of- nancial-modelling)
https://www.thesmallman.com/blog/2016/9/15/auto-highlight-the-active-row-when-a-cell-is-selected 4/6
10/22/2018 Auto-Highlight the Active Row When a Cell is Selected — Excel Dashboards VBA and more
(/blog/2018/4/5/social-media-dashboard-in-excel)
(/blog/2018/3/15/range-areas-in-excel-with-vba)
D a s h b o a r d i n g W i t h E x c e l ( / D a s h b o a r d i n g -W i t h - 3 St a t e m e n t M o d e l l i n g I n E xc e l ( / 3 -
E xc e l - C o u r s e ) Statement-Financial-Modelling) (HTTPS://WWW.FA
Visual Analytics (/Visual-Analytics-Course) Project Financial Modelling (/Project-
549588165139776
A d v a n c e d D a s h b o a r d D e s i g n I n E xc e l ( / A d v a n c e d - Financial-Modelling)
Dashboard-Design) PowerPivot (/Powerpivot)
(HTTPS://TWITTER
F i n a n c i a l M o d e l l i n g I n E xc e l ( / F i n a n c i a l - M o d e l l i n g - E xc e l Au t o m a t i o n W i t h V B A ( / E xc e l -
I n - E xc e l - C o u r s e ) A u t o m a t i o n -W i t h -V b a )
(HTTPS://AU.PINT
A d v a n c e d F i n a n c i a l M o d e l l i n g I n E xc e l ( / A d v a n c e d - F i n a n c i a l M o d e l l i n g W i t h V B A ( / F i n a n c i a l -
Financial-Modelling-Course) (HTTPS://WWW.LI
M o d e l l i n g -W i t h -V b a - C o u r s e )
TRK=HP-IDENTITY
marcussmall@thesmallman.com
(mailto:marcussmall@thesmallman.com
https://www.thesmallman.com/blog/2016/9/15/auto-highlight-the-active-row-when-a-cell-is-selected 5/6
10/22/2018 Auto-Highlight the Active Row When a Cell is Selected — Excel Dashboards VBA and more
T H E S M A L L M A N . C O M - M A K I N G YO U R S M A L L SYS T E M S H U M . . .
© COPYRIGHT THESMALLMAN.COM ALL RIGHTS RESERVED.
https://www.thesmallman.com/blog/2016/9/15/auto-highlight-the-active-row-when-a-cell-is-selected 6/6