Excel VBA Cannot call function with onaction -


i write script ok button in userform create delete button on sheet delete whole line. problem when click delete button, cannot call function assigned onaction parameter.

private sub okbutton_click()     dim emptyrow long     'make feuil1 active     feuil1.activate      'determine emptyrow     emptyrow = worksheetfunction.counta(range("c:c")) + 1      dim deletebutton button     dim t range      set t = activesheet.range(cells(emptyrow, 2), cells(emptyrow, 2))     set deletebutton = activesheet.buttons.add(t.left, t.top, t.width, t.height)     deletebutton         .onaction = "deleteline"         .caption = "delete" & emptyrow         .name = "deletebutton" & emptyrow     end      'close user form     unload me  end sub  sub deleteline()     msgbox "you clicked me" end sub 


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -