+ Reply to Thread
Results 1 to 9 of 9

Highlight row and column of selected cell

  1. #1
    Registered User
    Join Date
    03-04-2015
    Location
    Switzerland
    MS-Off Ver
    365
    Posts
    93

    Highlight row and column of selected cell

    Hi there,
    I am trying to use conditional formatting to highlight the row and column of a selected cell.
    is there a way to do it without a macro?

    cheers

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: Highlight row and column of selected cell

    No. There is no built-in way to give you the address of the currently selected cell. If you do want a macro, I can help with that.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    03-04-2015
    Location
    Switzerland
    MS-Off Ver
    365
    Posts
    93

    Re: Highlight row and column of selected cell

    Thanks for quick replay. Yes - I would appreciate a macro help (even tough I am not very familar

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: Highlight row and column of selected cell

    This method is not the only way to do it but it's one I came up with fairly quickly. It makes minimal use of macros, and uses conditional formatting to actually format the cells.

    This solution works only for one specific worksheet.

    It detects whenever the selection changes. It uses a hidden sheet Selection Address to store the address of the current selection. The conditional formatting rules refer to this address to determine when formatting applies.

    In this example, CF has been applied to A1:M20. Theoretically you could apply it to the entire sheet although many people have reported performance degradation when applying CF to large numbers of cells.

  5. #5
    Registered User
    Join Date
    03-04-2015
    Location
    Switzerland
    MS-Off Ver
    365
    Posts
    93

    Re: Highlight row and column of selected cell

    This is very helpful. Thank you for support.
    I am trying to run this type of highlighting on several worksheets. is there a way to overcome the supporting sheet (again- I am not such a macro person...)

    Cheers. Swiss Excel

  6. #6
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: Highlight row and column of selected cell

    If you want a macro solution then this is possible. See the attachment.

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: Highlight row and column of selected cell

    Quote Originally Posted by sanram View Post
    If you want a macro solution then this is possible. See the attachment.
    This is effective for multiple sheets. However, please note that this method uses permanent formatting, then when the cursor moves removes that formatting. Therefore, if your sheet has other fill colors on it to start with, they will be lost if you select cells in the same row or column. That is the reason I used conditional formatting to implement my version. If this is not an issue for you then this is a good solution.

    I will take a look tomorrow and see what options are available for extending my solution for multiple sheets.

  8. #8
    Registered User
    Join Date
    03-04-2015
    Location
    Switzerland
    MS-Off Ver
    365
    Posts
    93

    Re: Highlight row and column of selected cell

    Sanram - thank you for sending the file. this is close to what I am looking (it does change the entire colors of my table so this is not the ideal), but I can somehow live with it...
    Question - I would like to copy paste your formula into my own sheet. How do I do that? I have the developer tab, but I wasnt sure where to insert the vba formula and what to do next...

    (I am far from being VBA expert)

    Cheers

  9. #9
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: Highlight row and column of selected cell

    Click on View code at developers tab. Then double click on ThisWorkbook on Project Panel at Left. Now you will see all the codes there. Copy all the codes and paste it at the same location of your main file.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Highlight Column When Cell Selected Without Removing the Sheets Other Background Colours
    By mackenzie.costello in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 05-15-2015, 09:19 AM
  2. How to highlight a cell in first column if the particular cell is selected?
    By ANUARORA in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-01-2014, 04:27 AM
  3. [SOLVED] Ability to auto-highlight entire row and column of selected cell
    By stephenminton in forum Excel General
    Replies: 22
    Last Post: 04-02-2014, 02:35 PM
  4. Highlight first cell in a row and specific row in column if cell is selected
    By Abbadon486 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-29-2014, 08:54 AM
  5. Defining a range to highlight column and row in line with selected cell
    By ACM2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-19-2012, 11:13 PM
  6. Replies: 1
    Last Post: 05-22-2006, 05:10 AM
  7. [SOLVED] How to highlight row and column of the selected cell
    By Row_Column_Highlight in forum Excel General
    Replies: 2
    Last Post: 02-27-2005, 07:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1