Is there any way to catch paste event in excel vba. I mean - I need to catch it, check if there is any dollar sign and if so change the address, otherwise paste it without changes.
In a cell there is a formula with constant $J$<row>, where row changes for each 20 rows. When someone is coping/pating a row I want to check is thers this formula and if so I want to find proper row number and replace it in formula. I'm trying to use change property and I think that is ok - I can check range object. The problem is that when I'm using Worksheetfunction.search/Worksheetfunction.find (Worksheetfunction.search("$J$",Target.cells(i,j).Formula)) I get RE 1004... Any idea what to do?? How vcan I check for $J$ in formula??
I decided to use a hidden column solution, so now there is no need to check what users are coping/pasting. Anyway it is nice to know that there is such a function in VBA (I don't have help files installed so actually it is really hard for me to check anything). Maybe I am wrong, but should any worksheets function be used in VBA code or it is better to use VBA function instead in any case?
It would generally be better to use a VBA function BUT there tend to be subtle differences in what would seem to be similar functions so you can get some different functionality by using worksheet functions within VBA.
Rgds, Geoff
Three things are certain. Death, taxes and lost data. DPlank is to blame
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.