How to highlight today's input

feelkg211

New Member
Joined
Apr 12, 2017
Messages
30
In work, we have a table where in the first row is a list of the products and the first column are days of the week. Here, we list the amount of items per product needed to be delivered in the week. We do this daily. Is there a way to only highlight the cells that we edited/put numbers in for today?

Thank you very much!
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Here is a photo for sample
Yj5iH
 
Upvote 0
See if this does what you want. This is sheet code for the worksheet that holds the table. It assumes the layout shown in your image. At the start of each day, double-click cell A1 on that sheet to clear the color fill from the previous day's use.
To install the code:
1. Right-click the worksheet tab you want to apply it to and choose 'View Code'. This will open the VBE window.
2. Copy the code below from your browser window and paste it into the white space in the VBE window.
3. Close the VBE window and Save the workbook. If you are using Excel 2007 or a later version do a SaveAs and save it as a macro-enabled workbook (.xlsm file extension).
4. Make sure you have enabled macros whenever you open the file or the code will not run.
Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Address = "$A$1" Then Range("B3:K9").Interior.Color = xlNone
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Range
If Not Intersect(Target, Range("B3:K9")) Is Nothing Then
    For Each c In Intersect(Target, Range("B3:K9"))
        Target.Interior.ColorIndex = vbYellow
    Next c
End If
End Sub
 
Upvote 0
JoeMo:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Range
If Not Intersect(Target, Range("B3:K9")) Is Nothing Then
    For Each c In Intersect(Target, Range("B3:K9"))
[B][COLOR=#ff0000]        Target.Interior.Color = vbYellow[/COLOR][/B]
    Next c
End If
End Sub
 
Upvote 0
JoeMo:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim c As Range
If Not Intersect(Target, Range("B3:K9")) Is Nothing Then
    For Each c In Intersect(Target, Range("B3:K9"))
[B][COLOR=#ff0000]        Target.Interior.Color = vbYellow[/COLOR][/B]
    Next c
End If
End Sub
Oops, good catch Logit. Note to the OP - make the change shown in red in Post #5.
 
Upvote 0
I underestimated the difficulty of the code.

Here's an actual photo of our file. (I had to hide certain names) could you please walk me through it step by step? As you can see our excel is in Japanese :eeek:

<strike></strike>http://imgur.com/a/Md5eg<strike></strike>
 
Upvote 0
Upvote 0
Walk you through what? Can you explain what you mean by "underestimated the difficulty of the code"?

The first example I gave seems to be too simple in comparison to my actual file. Will the code still be applicable despite this difference? Could you walk me through step by step, like where the buttons are located, which one to click, because my excel in the office is in Japanese and I am still learning the language.

Thank you so much!!
 
Upvote 0
The first example I gave seems to be too simple in comparison to my actual file. Will the code still be applicable despite this difference? Could you walk me through step by step, like where the buttons are located, which one to click, because my excel in the office is in Japanese and I am still learning the language.

Thank you so much!!
Best to tell us what you really need rather than waste time on "examples" that don't reflect real life. The code I gave you will run automatically when a change is made to any cell in the target range - there are no buttons. So, tell what range you want to monitor for changes? The code I posted, based on your image, is monitoring B3:K9.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,331
Members
452,636
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top