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!
 
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.

I`m really sorry if you feel like I wasted your time, but it was not my intention. Could I upload the actual file here?
 
Upvote 0

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
I`m really sorry if you feel like I wasted your time, but it was not my intention. Could I upload the actual file here?
You can't upload files to this site. All I need to know is in what range do you "list the amount of items per product needed to be delivered in the week"? If you can give me that and follow the step-by-step instructions for installing the code I gave you in post #4, you will have something that automatically does what you want.
 
Upvote 0
Instead of B1, can I use a command button? What will the code look like?
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

Forum statistics

Threads
1,224,829
Messages
6,181,219
Members
453,024
Latest member
Wingit77

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