ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   excel search a sheet for a value (https://www.excelbanter.com/excel-programming/277021-re-excel-search-sheet-value.html)

masim

excel search a sheet for a value
 
Use the following code and see if it helps...

Sub Button1_Click()

Dim fnd As String



fnd = InputBox("What do u want to Find?")
Range("A1").Select
Cells.Find(What:=fnd, After:=ActiveCell, LookIn:=xlFormulas, LookAt
_
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Activate

ActiveCell.Offset(1, 0).Activate
Range(Selection, Selection.End(xlDown)).Select
Selection.EntireRow.Select
Selection.Copy





End Sub



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



All times are GMT +1. The time now is 06:19 AM.

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