View Single Post
 
Old 05-17-2020, 01:05 AM
alex100 alex100 is offline Windows 7 64bit Office 2016
Advanced Beginner
 
Join Date: May 2020
Posts: 79
alex100 is on a distinguished road
Default Pass variables to the 'EditPaste' sub

I have a subroutine that is executed when pressing CTRL-V (paste function). It's called 'EditPaste'.

I also have a second subroutine from which I need to make a call to the 'EditPaste' sub. With this call, I need to pass a variable from this second sub to the 'EditPaste' sub. For more clarity, here's the code...

Code:
Sub EditPaste(variable)
  
  'code here...

End Sub
Code:
Sub second_subroutine

  Call EditPaste("value")

End Sub
It works well, meaning that I can indeed access the variable value inside the EditPaste subroutine.

The problem is that the 'EditPaste' sub will no longer execute when pressing the CTRL+V key combination. So it executes well when using the 'Sub EditPaste' code, but not at all when using the 'Sub EditPaste(variable)' code.

How can I pass variables to 'EditPaste' and be able to execute it with CTRL+V at the same time?

Alex
Reply With Quote