Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default 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/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't change the active cell when navigating a spreadsheet Russ Excel Discussion (Misc queries) 1 March 24th 10 05:44 PM
Can I copy a field from another spreadsheet based on search? Faye Excel Worksheet Functions 3 July 17th 08 11:36 PM
Insert a number of rows based on a value in a cell on active row iRocco Excel Discussion (Misc queries) 1 August 11th 05 06:18 AM
Insert a number of rows based on a value in a cell on active row iRocco Excel Worksheet Functions 0 August 10th 05 08:46 PM
Select a range of columns based on active cell Tom Ogilvy Excel Programming 0 November 10th 03 05:09 PM


All times are GMT +1. The time now is 02:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"