LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #15   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Automatically Check Each Worksheet For Duplicate Entry

I don't understand.

Maybe someone else will jump in.

Hasan wrote:

On Sep 30, 6:37 am, Dave Peterson wrote:
Maybe there's a difference in the name of the sheet you're changing and what you
typed into the table in Sheet3.

I'd add:

msgbox "***" & sh.name & "***" & vblf & "***" & res & "***"

to see if I could see a difference.





Hasan wrote:

On Sep 30, 1:35 am, Dave Peterson wrote:
if lcase(sh.name) = lcase(res) then
'no message required
else
'show the message
end if


Hasan wrote:


On Sep 29, 5:20 am, Dave Peterson wrote:
Add target.clearcontents to clear the cell that had the value entered.


Hasan wrote:


On Sep 29, 2:23 am, Dave Peterson wrote:
I'm not sure if this gets incorporated into the earlier code or if it's for a
single sheet, but maybe this will get you started:


You could use something like:


Dim res as variant


res _
= application.vlookup(target.value,worksheets("Sheet 3").range("A:B"),2,false)


if iserror(res) then
msgbox "Not found on sheet3"
else
msgbox "This Number should go in " & res & "worksheet."
end if


Hasan wrote:


Coloum A data validation list in all worksheets is from sheets3 column
A. And Sheet3 has following data


Column A ColumnB
123456 Apple
456789 Orange
147894 Pineapple
159357 Orange


If the user is in appleworksheetand select value "456789"(which is a
new value in the workbook) from drop down a message box should pop up
saying "this Number should go in Orangeworksheet"


--


Dave Peterson


I have pasted this in the earlier code.


- Even though the value selected is for the correctworksheet, i am
getting the message which i should not


- Its not clearing the data after clicking "OK" on message box"


- As the Coloum A data validation list in all worksheets is from
sheets3 column A. Below code is not required


if iserror(res) then
msgbox "Not found on sheet3"


--


Dave Peterson- Hide quoted text -


- Show quoted text -


How do i aviod the message if the value selected is for the correct
sheet ?


--


Dave Peterson- Hide quoted text -


- Show quoted text -


I have edited the code as shown below and pasted in "ThisWorkbook" but
still the same. Its poping up the message for the selected values.


Dim res as variant
res _
= application.vlookup(target.value,worksheets("Sheet 3").range("A:B"),
2,false)


if lcase(sh.name) = lcase(res) then
'no message required
else
msgbox "This Number should go in " & res & "worksheet."
Target.Clearcontents
end if


--

Dave Peterson- Hide quoted text -

- Show quoted text -


Using below code is showing the acitive sheet name & the sheet3
columnB value

res _
= Application.VLookup(Target.Value, Worksheets("Sheet3").Range
("A:M"), 13, False)
If LCase(Sh.Name) = LCase(res) Then
'no message required
Else
MsgBox "***" & Sh.Name & "***" & vbLf & "***" & res & "***"
End If

But i want the macro to compare the columnA values(which is a data
validation drop down list) in sheets(apple, orage,pineapple) with
Sheet3 ColumnA value and if the selected value(in sheet "Orange")
shows "Apple" in Sheet3 Column B then message box "this belongs to
Apple worksheet" and clear contents(or insert the value in last row of
Apple worksheet) else if it shows "Orange" in Sheet3 Column B then no
message box


--

Dave Peterson


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding duplicate cells within a worksheet automatically Warren Excel Worksheet Functions 1 April 24th 09 04:00 PM
Duplicate Entry Tracy Excel Worksheet Functions 2 October 13th 08 10:37 PM
... Can I set Spell Check to automatically check my spelling ... Dr. Darrell Setting up and Configuration of Excel 0 March 21st 06 08:26 PM
Entry into check box dependent on other check box. Stilla Excel Worksheet Functions 9 December 10th 05 03:44 PM
how can I check a worksheet for duplicate entries or numbers? RFI Excel Worksheet Functions 1 October 19th 05 04:08 AM


All times are GMT +1. The time now is 01:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"