Beste Mensen,
Met onderstaande VBA code kan ik in elke cel in het werkblad dubbelklikken om datum en tijd te krijgen.
Het is de bedoeling dat de gebruiker dit alleen kan in het bereik B8:U9 en B38:U39.
Kan iemand de code aanpassen om bovenstaande te realiseren.
B.v.d. Jan.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
ActiveCell.FormulaR1C1 = "=NOW()"
With Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End Sub
Met onderstaande VBA code kan ik in elke cel in het werkblad dubbelklikken om datum en tijd te krijgen.
Het is de bedoeling dat de gebruiker dit alleen kan in het bereik B8:U9 en B38:U39.
Kan iemand de code aanpassen om bovenstaande te realiseren.
B.v.d. Jan.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
ActiveCell.FormulaR1C1 = "=NOW()"
With Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
End Sub