Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Excel VBA Highlighting cells on sheet change

Posted on 2014-10-26
2
Medium Priority
?
592 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 52

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

715 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