Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Excel VBA Highlighting cells on sheet change

Posted on 2014-10-26
2
Medium Priority
?
629 Views
Last Modified: 2014-10-27
Hi
I use the following code to highlight cells when values are changed. I also highlight
the last cell in that row to show that it has been changed
It works fine for one cell but when I copy the changed value
down with the mouse the cell that changes changes color but
the cell at the end of the row doesn't change color

Private Sub Worksheet_Change(ByVal Target As Range)
                    Application.Cells(Target.Row, Target.Column).Interior.Color = 65535
                    Application.Cells(Target.Row, 16384).Interior.Color = 65535
End Sub
0
Comment
Question by:Murray Brown
2 Comments
 
LVL 53

Accepted Solution

by:
Rgonzo1971 earned 2000 total points
ID: 40405795
Hi,

pls try

Private Sub Worksheet_Change(ByVal Target As Range)
    Target.Interior.Color = 65535
    Target.Offset(0, 16384 - Target.Column).Interior.Color = 65535
End Sub

Open in new window

Regards
0
 

Author Closing Comment

by:Murray Brown
ID: 40405858
Great answer. Thanks very much
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question