Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Store row number after a find
Following a find command I want to store the row number to a variablke and
use that to move to a columb on that row |
#2
|
|||
|
|||
hi,
what column? same column? different column? Regards FSt1 "Alan" wrote: Following a find command I want to store the row number to a variablke and use that to move to a columb on that row |
#3
|
|||
|
|||
Hello,
Any column on that row. Real problem is storing the 'found' row number to a variable "FSt1" wrote: hi, what column? same column? different column? Regards FSt1 "Alan" wrote: Following a find command I want to store the row number to a variablke and use that to move to a columb on that row |
#4
|
|||
|
|||
hi,
if you are using the built in find then you do have a problem. try this... Sub macfindrow() dim rn as string dim rng as range dim therow as long rn = inputbox("enter something to find") if rn < "" then Set rng = nothing Set rng = range("A1:IV65536").Find(what:=rn, _ After:=Range("A1"), _ Lookin:=xlformulas, _ Lookat:=xlpart, _ SearchOrder:=xlbyrows, _ SearchDirection:=xlNext, _ MatchCase:=false) end if therow = rng.row msgbox "Found at cell " & rng.address msbbox "The row number is " & therow end sub therow is the variable Regards FSt1 "Alan" wrote: Hello, Any column on that row. Real problem is storing the 'found' row number to a variable "FSt1" wrote: hi, what column? same column? different column? Regards FSt1 "Alan" wrote: Following a find command I want to store the row number to a variablke and use that to move to a columb on that row |
#5
|
|||
|
|||
Dear FSt1,
Thanks very good. I have modified slightly and now all is OK. What does FSt1 mean or stand for ? Alan "FSt1" wrote: hi, if you are using the built in find then you do have a problem. try this... Sub macfindrow() dim rn as string dim rng as range dim therow as long rn = inputbox("enter something to find") if rn < "" then Set rng = nothing Set rng = range("A1:IV65536").Find(what:=rn, _ After:=Range("A1"), _ Lookin:=xlformulas, _ Lookat:=xlpart, _ SearchOrder:=xlbyrows, _ SearchDirection:=xlNext, _ MatchCase:=false) end if therow = rng.row msgbox "Found at cell " & rng.address msbbox "The row number is " & therow end sub therow is the variable Regards FSt1 "Alan" wrote: Hello, Any column on that row. Real problem is storing the 'found' row number to a variable "FSt1" wrote: hi, what column? same column? different column? Regards FSt1 "Alan" wrote: Following a find command I want to store the row number to a variablke and use that to move to a columb on that row |
#6
|
|||
|
|||
my name is Frank Stone
FStone FSt one how do you spell the number 1 Regards FSt1 "Alan" wrote: Dear FSt1, Thanks very good. I have modified slightly and now all is OK. What does FSt1 mean or stand for ? Alan "FSt1" wrote: hi, if you are using the built in find then you do have a problem. try this... Sub macfindrow() dim rn as string dim rng as range dim therow as long rn = inputbox("enter something to find") if rn < "" then Set rng = nothing Set rng = range("A1:IV65536").Find(what:=rn, _ After:=Range("A1"), _ Lookin:=xlformulas, _ Lookat:=xlpart, _ SearchOrder:=xlbyrows, _ SearchDirection:=xlNext, _ MatchCase:=false) end if therow = rng.row msgbox "Found at cell " & rng.address msbbox "The row number is " & therow end sub therow is the variable Regards FSt1 "Alan" wrote: Hello, Any column on that row. Real problem is storing the 'found' row number to a variable "FSt1" wrote: hi, what column? same column? different column? Regards FSt1 "Alan" wrote: Following a find command I want to store the row number to a variablke and use that to move to a columb on that row |
#7
|
|||
|
|||
Frank,
Can you help with an embelishment to your solution. How can I trap a NO FIND following the find command you supplied "FSt1" wrote: my name is Frank Stone FStone FSt one how do you spell the number 1 Regards FSt1 "Alan" wrote: Dear FSt1, Thanks very good. I have modified slightly and now all is OK. What does FSt1 mean or stand for ? Alan "FSt1" wrote: hi, if you are using the built in find then you do have a problem. try this... Sub macfindrow() dim rn as string dim rng as range dim therow as long rn = inputbox("enter something to find") if rn < "" then Set rng = nothing Set rng = range("A1:IV65536").Find(what:=rn, _ After:=Range("A1"), _ Lookin:=xlformulas, _ Lookat:=xlpart, _ SearchOrder:=xlbyrows, _ SearchDirection:=xlNext, _ MatchCase:=false) end if therow = rng.row msgbox "Found at cell " & rng.address msbbox "The row number is " & therow end sub therow is the variable Regards FSt1 "Alan" wrote: Hello, Any column on that row. Real problem is storing the 'found' row number to a variable "FSt1" wrote: hi, what column? same column? different column? Regards FSt1 "Alan" wrote: Following a find command I want to store the row number to a variablke and use that to move to a columb on that row |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how do i find the lowest number in a column in Excel? | Excel Discussion (Misc queries) | |||
Number formatting | Excel Discussion (Misc queries) | |||
Find number of days between to dates | Excel Worksheet Functions | |||
How do I find highest number in a row and change color? | Excel Worksheet Functions | |||
How to format a number in Indian style in Excel? | Excel Discussion (Misc queries) |