Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello Excel/VBA gurus,
I'm trying to create a script that would give me the row value of cell containing a unique key word I am looking. I am thinking of options to do this: 1. Select the column, then go through each rows in the column from u to down and compare if the value of the row contains my keyword. I not, go to the next row until the keyword is found. 2. Select the column. Use a VBA function, of which I don't know, t find the keyword. Once the row number of the keyword is found, assign the row numbe before this as my last "valid" row. Can someone help me with the codes for the two options above? Thanks in advance for your help! :) Sinobat -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim rng as Range
Dim lastRow as Long set rng = Columns(1).Find("ABCD") if not rng is nothing then lastRow = rng.offset(-1,0).row rng.offset(-1,0).Select else msgbox "ABCD not found" End if no reason to pursue method 1. -- Regards, Tom Ogilvy "Sinobato " wrote in message ... Hello Excel/VBA gurus, I'm trying to create a script that would give me the row value of a cell containing a unique key word I am looking. I am thinking of 2 options to do this: 1. Select the column, then go through each rows in the column from up to down and compare if the value of the row contains my keyword. If not, go to the next row until the keyword is found. 2. Select the column. Use a VBA function, of which I don't know, to find the keyword. Once the row number of the keyword is found, assign the row number before this as my last "valid" row. Can someone help me with the codes for the two options above? Thanks in advance for your help! :) Sinobato --- Message posted from http://www.ExcelForum.com/ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to determine cursor location? | Excel Discussion (Misc queries) | |||
How to determine the cell location? | Excel Worksheet Functions | |||
Macro - save to current location vs excel default location | Excel Discussion (Misc queries) | |||
Excel 2000 Help File - What keyword | Excel Discussion (Misc queries) | |||
Determine the location of an external source of pivot table? | Excel Worksheet Functions |