ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Check whether data exists in Sheet.. (https://www.excelbanter.com/excel-programming/275427-check-whether-data-exists-sheet.html)

Soniya

Check whether data exists in Sheet..
 
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

kiat

Check whether data exists in Sheet..
 
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(rang e("c4").text)
if not sc is nothing then msgbox xc.text & " exists in " & range("c12").text

The code is untested, use as a guide.

"Soniya" wrote in message
...
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





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

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