ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Prevent Coping/Transffering item twice from Listbox1 to Listbox2 (https://www.excelbanter.com/excel-programming/443908-prevent-coping-transffering-item-twice-listbox1-listbox2.html)

K[_2_]

Prevent Coping/Transffering item twice from Listbox1 to Listbox2
 
Hi all, I am coping/transffering items from listbox1 to listbox2.
how can I prevent coping/transffering item twice by code. I want some
kind of code which popup message saying "You already have copied this
item" etc. Please can any friend can help

CellShocked

Prevent Coping/Transffering item twice from Listbox1 to Listbox2
 
On Thu, 18 Nov 2010 02:06:32 -0800 (PST), K
wrote:

Hi all, I am coping/transffering items from listbox1 to listbox2.
how can I prevent coping/transffering item twice by code. I want some
kind of code which popup message saying "You already have copied this
item" etc. Please can any friend can help



Test the cell contents for a match, and return the script to the error
message.

Unless there *can* be the same data there, from a previous fill. Then
all bets are off.

If the rule is that the only data in listbox2 is data that was only
ever copied over from listbox1, then it can be emptied before the copy
action, OR you can copy box2 to a new box3 and then make the box1 to box2
copy, then compare the box2 to box3 for a complete match. It does *NOT*
prove that a previous copy occurred. It would only prove that the data
was the same, not when or how it got there.

You could do that by tracking the button press date and time and then
examine/test that during the operation, and set rules for what times and
dates constitutes a recent copy operation.

Another way would be to empty the box after it gets utilized. Then you
never have to worry.


All times are GMT +1. The time now is 05:02 PM.

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