ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   don't allow row to be copied twice (https://www.excelbanter.com/excel-programming/425129-dont-allow-row-copied-twice.html)

tracktraining

don't allow row to be copied twice
 
Hi All,

Is there a way for me to not allow the same row to be copy over to another
sheet twice?

any suggestion is much appreciated!


thanks,
tracktraining
--
Learning

Dave Peterson

don't allow row to be copied twice
 
Can you pick out a key value that appears exactly once if the row was copied to
the other sheet.

If yes, you can use application.match() to look to see if it's already there.

Dim myCell as range
dim LookUpRng as range
dim res as variant 'could be an error

set mycell = worksheets("sheet999").range("x932")

with worksheets("sheetthat'scopiedto")
set lookuprng = .range("X:x")
end with

res = application.match(mycell.value, lookuprng, 0)

if iserror(res) then
'not there, do the copy|paste
else
'already there, skip it or merge the data nicely????
end if




tracktraining wrote:

Hi All,

Is there a way for me to not allow the same row to be copy over to another
sheet twice?

any suggestion is much appreciated!

thanks,
tracktraining
--
Learning


--

Dave Peterson

tracktraining

don't allow row to be copied twice
 
THANKS SO MUCH Again. I will give that a try tomorrow.

- tracktraining
--
Learning


"Dave Peterson" wrote:

Can you pick out a key value that appears exactly once if the row was copied to
the other sheet.

If yes, you can use application.match() to look to see if it's already there.

Dim myCell as range
dim LookUpRng as range
dim res as variant 'could be an error

set mycell = worksheets("sheet999").range("x932")

with worksheets("sheetthat'scopiedto")
set lookuprng = .range("X:x")
end with

res = application.match(mycell.value, lookuprng, 0)

if iserror(res) then
'not there, do the copy|paste
else
'already there, skip it or merge the data nicely????
end if




tracktraining wrote:

Hi All,

Is there a way for me to not allow the same row to be copy over to another
sheet twice?

any suggestion is much appreciated!

thanks,
tracktraining
--
Learning


--

Dave Peterson



All times are GMT +1. The time now is 12:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com