Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Alan
 
Posts: n/a
Default 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   Report Post  
FSt1
 
Posts: n/a
Default

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   Report Post  
Alan
 
Posts: n/a
Default

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   Report Post  
FSt1
 
Posts: n/a
Default

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   Report Post  
Alan
 
Posts: n/a
Default

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   Report Post  
FSt1
 
Posts: n/a
Default

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   Report Post  
Alan
 
Posts: n/a
Default

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
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
how do i find the lowest number in a column in Excel? MKA808 Excel Discussion (Misc queries) 4 August 23rd 05 07:27 PM
Number formatting Fred Holmes Excel Discussion (Misc queries) 2 February 21st 05 06:02 PM
Find number of days between to dates Qaspec Excel Worksheet Functions 1 January 21st 05 12:14 AM
How do I find highest number in a row and change color? pamstolen Excel Worksheet Functions 3 January 18th 05 12:35 AM
How to format a number in Indian style in Excel? Victor_alb Excel Discussion (Misc queries) 2 December 21st 04 04:21 AM


All times are GMT +1. The time now is 01:31 AM.

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

About Us

"It's about Microsoft Excel"