Results 1 to 10 of 10

Changing target cell formatting

Threaded View

  1. #1
    Registered User
    Join Date
    03-25-2004
    Posts
    54

    Changing target cell formatting

    Hey, guys. What's up?

    I'd like to know if it's possible to do something like this...

    1) I click or simply move the cursor to a certain cell, say, B10.
    2) That cell (B10) gets highlighted (by highlighted, I mean, its background color gets changed into red, for instance).
    3) I leave the cell (B10) by clicking or moving the cursor to another cell, say, B11.
    4) The cell I left (B10) gets its formatting back; same cell formatting it had before I clicked on it.

    teylyn has already helped me with something similar. Take a look, please.

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim lrow As Long
    On Error Resume Next
    lrow = Range("A18").End(xlDown).Row
    Application.ScreenUpdating = False
    If Intersect(Target, Range("A18", Range("G" & lrow))) Is Nothing Then
        Rows("18:" & lrow).RowHeight = 13.25
    Else
        Rows("18:" & lrow).RowHeight = 13.25
        Target.RowHeight = 20
    End If
    Application.ScreenUpdating = True
    End Sub
    By the way, it's easy to do this when I already know the target cell formatting. However, if I have a big range of cells with different formatting, it's more complicated (to me, of course). That's why I want to know if it's possible to do it automatically for the whole formatting (background color, font color, borders, everything).

    It would be something like... When I click a cell, Excel copies the formatting of that cell and then changes its background color (so it gets highlighted). Then, when I leave that cell, Excel pastes that formatting back on it.

    I hope you can help. I really don't know how to do that.

    Thank you very much for your attention, guys.

    brunces
    Last edited by brunces; 04-18-2016 at 08:04 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Changing row height of target cell
    By brunces in forum Excel General
    Replies: 2
    Last Post: 04-14-2016, 07:25 PM
  2. Solver is not changing values in target cell using through VBA
    By brajpalshishodia in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-19-2015, 02:52 PM
  3. Changing Formula based on what is in the target cell
    By 5upgraphics in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-02-2014, 05:54 PM
  4. Replies: 5
    Last Post: 01-22-2013, 11:38 AM
  5. Date format in cell Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    By Hilton1982 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-15-2012, 03:22 AM
  6. Is target.offset my answer? Adapting code to format an adjacent cell.
    By thespianchef in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-19-2012, 04:18 PM
  7. Replies: 5
    Last Post: 04-29-2010, 07:11 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