-
VBA knowing which cells it has filled?
Since a VBA function unlike a sub allows you to select the cells you want, place the function in the bar on top, and then press CTRL+SHFT+ENTR to populate, is there a way for VBA without actually exiting the code to figure out which cells were populated?
For example, would I be able to run a sub right before exiting the function which would determine which cells have been populated?
Thanks!
-
You can use the sheet's Selection event or Application.OnKey.
e.g.
[VBA]Sub SetOnKey()
MsgBox Selection.Address
End Sub
Sub SetOnKey_()
Application.OnKey "^+{RETURN}", "SetOnKey"
End Sub[/VBA]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules