Check whether data exists in Sheet..

S

Soniya

Hi All,

I have to enter in my sheet1 c4 Name
in C12 i have three sheet names like Sheet1, sheet2,
sheet3

When i reach C13 i have to check whther the name I
entered already exixts in the specific sheet ie. for eg.
if my C12 contains sheet2 i want to check the name
entered in C4 already exixts in Sheet2 Range A1 thru end
of list (dynamic)

If the name exists then msg box alerting and select c4 ..

Hoew can I code this?

is it possible to do it other than in Worksheet_Change or
Worksheet_SelectionChange since i have several code
already there?
just call this macro from there?
I have already some code based on my selection of C13.
i want to check this one also while i am in C13

any help?

TIA
Soniya
 
K

kiat

In your C13 bit of code in worksheet_change event, add this

dim xc as range
set xc = worksheets(range("c12").text).columns(1).find(range("c4").text)
if not sc is nothing then msgbox xc.text & " exists in " & range("c12").text

The code is untested, use as a guide.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top