ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA newbie - can i search the spreadsheet based on the active cell? (https://www.excelbanter.com/excel-programming/288369-vba-newbie-can-i-search-spreadsheet-based-active-cell.html)

ciupe

VBA newbie - can i search the spreadsheet based on the active cell?
 
Hi Guys.

I'm new to VBA... and untill i get a book to help me out, let me giv
you guys a try.

I want to search my sheet with the value in the active cell (or
speciffic cell). Is that possible?

I'm trying to do a simple inventory sheet. I enter the item numbe
(0024 for example), and excel reports the row its in.

I can make it fancier from there but i need excel to return the row th
result is in.

Tell me what functions in vba to look up, or some sample code. I'
sure i can decipher it. Thanx :

--
Message posted from http://www.ExcelForum.com


Nikos Yannacopoulos[_5_]

VBA newbie - can i search the spreadsheet based on the active cell?
 
ItemCode = Activecell.Value
Cells.Find(What:=ItemCode, After:=ActiveCell, LookIn:=xlFormulas,
LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False _
).Activate
ItemRow = Activecell.Row

HTH,
Nikos

"ciupe " wrote in message
...
Hi Guys.

I'm new to VBA... and untill i get a book to help me out, let me give
you guys a try.

I want to search my sheet with the value in the active cell (or a
speciffic cell). Is that possible?

I'm trying to do a simple inventory sheet. I enter the item number
(0024 for example), and excel reports the row its in.

I can make it fancier from there but i need excel to return the row the
result is in.

Tell me what functions in vba to look up, or some sample code. I'm
sure i can decipher it. Thanx :)


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 11:18 AM.

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