Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to extract the row number of a cell with certain value
Hi, I am trying to extract the row number of a cell with a particular
value. For example, I have a cell with the value '1-A54' in it, and I am trying to get the row number where this value appear. Can anybody tell me how to write it in VBA? Thanks a lot. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to extract the row number of a cell with certain value
Hi There,
Think this will work. Just from memory so please forgive me if I have missed something. Dim RowNum As Integer Dim ColNum as Integer Dim RowFoundOn as Integer Dim ImFinished as Boolean RowNum = 0 ColNum = 1 '*** set to column A, change to the column containing values you are searching for. Do RowNum = RowNum + 1 Cells(RowNum,ColNum).Select If Cells(RowNum,ColNum).Value = "1-A54" RowFoundOn = ActiveCell.Row ImFinished = True End If Loop Until ImFinished All the best, Steve Wilson. "houston city" wrote in message ... Hi, I am trying to extract the row number of a cell with a particular value. For example, I have a cell with the value '1-A54' in it, and I am trying to get the row number where this value appear. Can anybody tell me how to write it in VBA? Thanks a lot. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
how to extract the row number of a cell with certain value
Hi
one way: msgbox application.match("1-A54",Range("A1:A1000"),0) or use the Find method (see VBA help for an example) -----Original Message----- Hi, I am trying to extract the row number of a cell with a particular value. For example, I have a cell with the value '1-A54' in it, and I am trying to get the row number where this value appear. Can anybody tell me how to write it in VBA? Thanks a lot. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Extract everything to the right in cell when a number is encounter | Excel Worksheet Functions | |||
how do i extract a number from a cell with no spaces? | Excel Worksheet Functions | |||
Extract sheet name/number to cell | Excel Discussion (Misc queries) | |||
Extract number in middle of cell | Excel Worksheet Functions | |||
Extract number from name of cell | Excel Programming |