Hello, I want to add the date at the end of a line with a button. It's to follow how many time our product are cleanned. I want to have on a line : the product name, a button and all the date of cleanning. And when you click at the button, the date add at the end of the line
Here is an elegant approach to solving the problem without any button :).
Example in the included file.
Enter the right mouse button in the area A1:B10 and the date appears, pressing it again disappears the date.
Private Sub Worksheet_BeforeRightClick(ByVal Target As Excel.Range, Cancel As Boolean)
If Not Intersect(Target, Range("A1:B10")) Is Nothing Then
Target = IIf(Target = "", Date, "")
Cancel = True
Hope I was able to help you with this approach :).