excel - Passing through variable to sub in VBA -


this basic, have tried many things , give errors.

basically i'm trying run procedure every time cell gets changed in excel. i'm using sub worksheet_change(byval target range). works well, in procedure, i'm calling sub procedure several times.

i want reuse 'target' value in procedure, reason, can't find how it. tried placing 'public rtarget range' , 'rtarget = target' @ beginning of procedure. rtarget stays empty when call sub procedure.

how make work? i'm adding target 1 of variables to subroutine, looks stupid.

thanks!

private sub worksheet_change(byval target range)     mysub target end sub  sub mysub(byval target range)     ' sub code goes here , can work target range worksheet_change event end sub 

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -