Active Cell Border

Solved
Remi2236 Posted messages 89 Status Member -  
Remi2236 Posted messages 89 Status Member -
Bonjour,

I would like to ensure that in my Excel file, when I click on a cell, a border appears around the row of the active cell but within a specified range.

I want this border to not outline each cell of the row but to create a global border for the entire row within a given range: for example, if I select cell A4 and my table is from A1 to A10 in terms of rows, then a border should appear from A1 to A10. Similarly, if I select cell C7, a global border should appear from C1 to C10.

I should clarify that I found solutions online, but each time either they erase my formulas from the selected row, or when I click on a cell, it works initially, but when I change cells, it does not restore the previous formatting. For example, my table is a two-way table. I have the names of my patients on the left at the beginning of the row with a blue background. One can imagine that when I click on a cell in the row following this name and that it becomes gray, I want that when I click on a cell in another row, my titles revert to their original color, which is blue in this case.

I hope I have been clear enough for you, and thank you once again for your incredible services!

Best regards,

Rémi

2 answers

  1. via55 Posted messages 14393 Registration date   Status Member Last intervention   2 759
     
    Hello,

    Not much, a simple macro in the worksheet of the sheet that creates a temporary conditional formatting will do the trick
    We can either underline the row of the active cell with a colored line (but not one at the same time above) or color the active row
    You have both examples here: https://mon-partage.fr/f/zrLTk57C/
    ALT+F11 to open the VBA editor and see the macros and modify them (double click on the concerned sheet in the tree structure)

    Best regards
    Via

    --
    "Imagination is more important than knowledge." A. Einstein
    2
    1. Remi2236 Posted messages 89 Status Member 1
       
      I chose to color the line ;) thank you Via! Have a great day to you

      Best regards,

      Rémi
      0
  2. via55 Posted messages 14393 Registration date   Status Member Last intervention   2 759
     
    Good evening

    You talk about rows and then you give a range in column (A1:A10), it's not clear!
    Do you want that when you select a cell, the entire row (within the table width limit) is temporarily highlighted or that the entire column is highlighted?

    Best regards
    Via

    0
    1. Remi2236 Posted messages 89 Status Member 1
       
      May the entire line of the active cell, within the limits of the table, be bordered without a background color, just the outline of the entire row temporarily. And that it does not erase my current formatting or my current formulas.
      I know I'm asking a lot :)
      0