ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find text in Column or Range Name (https://www.excelbanter.com/excel-programming/347998-find-text-column-range-name.html)

Lankchevy

Find text in Column or Range Name
 
I'm using the following code to find a text entered in a textbox to
keep the user from entering a duplicate text, but it's searcing the
entire sheet. I just want the code to search column A.

Cells.Find(What:=TextBox1, After:=ActiveCell,
LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:=False) _
.Activate


How do I set the find for column A only?
Darrell


Bob Phillips[_6_]

Find text in Column or Range Name
 
Columns(1).Find(What:=TextBox1, After:=ActiveCell,
LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:=False) _
.Activate


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Lankchevy" wrote in message
oups.com...
I'm using the following code to find a text entered in a textbox to
keep the user from entering a duplicate text, but it's searcing the
entire sheet. I just want the code to search column A.

Cells.Find(What:=TextBox1, After:=ActiveCell,
LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:=False) _
.Activate


How do I set the find for column A only?
Darrell




Lankchevy

Find text in Column or Range Name
 
Bob,
Thanks for the assistance.
Darrell



All times are GMT +1. The time now is 12:00 AM.

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