Home count and record number of times i press the enter key
Reply: 0

count and record number of times i press the enter key

user639
1#
user639 Published in June 19, 2018, 4:28 pm

i want to create a sub that records in a list how many times you pressed the return key in the current session (it should write on a new line each time you reopen the file) heres are my attempts: somehow it's not working

Option Explicit

Private Sub Worksheet_activated(ByVal target As Range)
  Target.Value = target.Value + 1
  Application.OnKey "~", "CountDT"
End Sub

Private Sub worksheet_deactivated()
   Application.OnKey "~"
End Sub

Option Explicit
Sub CountDT()
    ActiveCell.Offset(1, 0).Select
    ActiveCell.Value = ActiveCell.Value & " " & Date & " " & Time
End Sub
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.368979 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO