Home > Software engineering >  To EXCEL in the method to realize control button to perform regularly every day
To EXCEL in the method to realize control button to perform regularly every day

Time:11-15

I have a EXCEL table, assuming he is open 24 hours, one of the SHEET inside CommandButton1_Click () button, I want to achieve every day at 3 p.m. automatically performs a CommandButton1 button, what method can be implemented, online to find a lot of, but can't realize, for which the great spirit is there a way to get everything right,

CodePudding user response:

 Sub demo () 
Application. The OnTime TimeValue (" 15:00:00 "), "the button click event process name"
End Sub

CodePudding user response:

Tried the following two statements, in the thisworkbook or new modules are not, to the time no response, I don't know where the problem is,

Sub demo ()
Application. The OnTime TimeValue (" 20:28:00 "), "CommandButton1_Click ()", "
End Sub

Sub demo ()
Application. The OnTime TimeValue (" 20:18:00 "), "ThisWorkbook. Sheets (" Sheet1"). CommandButton1_Click "
End Sub

CodePudding user response:

The code migration on a mission to another module named RunX, assume the process in the button click event call RunX below, is also specified in ontime RunX try
Generally not recommended directly write functional code in the event of a button
  •  Tags:  
  • VBA
  • Related