+ Reply to Thread
Results 1 to 4 of 4

Temporary highlight row of active cell whilst retaining original formatting

  1. #1
    Registered User
    Join Date
    06-10-2013
    Location
    london, engalnd
    MS-Off Ver
    Excel 2010
    Posts
    10

    Temporary highlight row of active cell whilst retaining original formatting

    Hi.

    So the following seems to work in highlighting the activie cells correctly.

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Application.ScreenUpdating = False
    Cells.Interior.ColorIndex = xlNone
    If Target.Columns.Count = 1 Then
    Target.EntireColumn.Interior.ColorIndex = 6
    End If
    End Sub


    however, the table I have contains multiple styles of formatting - for example:

    cell 1A contains text in bold
    cell 1B contains a date and has blue highlighting (cell fill)
    cell 1C contains numbers and text - and the letters are coloured in red.

    And when I use the code it deletes all the formatting. what I would like is an amendment to the code so that it does not change the formatting. for example when I click on row 1 then the whole row is highlighted in yellow even cell 1B. but as soon as I click on row 2 then all of row 2 is highlighted in yellow and row 1 reverts back to the formatting it originally had i.e. cell 1B will still have cell fill as blue.

    Thanks In Advance.

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Temporary highlight row of active cell whilst retaining original formatting

    Hello kmis,

    Maybe something as per the attached sample Workbook?

    See Conditional Formatting, and VBA code.

    Regards.
    Attached Files Attached Files
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Registered User
    Join Date
    06-10-2013
    Location
    london, engalnd
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Temporary highlight row of active cell whilst retaining original formatting

    Winon - that is perfect and works like a dream for me. thank you kindly.

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Temporary highlight row of active cell whilst retaining original formatting

    Hello kmis,

    Thank you for the feedback.

    You are Welcome. Glad I could help. Please mark your thread as solved.

    Also, thank you for the Rep tap, I appreciate it.

    Regards

+ 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. Temporary highlight row of active cell
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-18-2015, 08:01 AM
  2. Inserting a picture symbol into cell while retaining original text
    By EmmaO91 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-22-2014, 04:22 AM
  3. Auto highlight row and column of active cell without changing formatting
    By GRamirez in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-20-2012, 11:35 AM
  4. Retaining original formatting on cell being copied to
    By Alkemac in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-15-2009, 04:59 AM
  5. Adding rows whilst retaining formulas and formatting
    By Forbez in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-25-2008, 11:02 AM

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