Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Determining Row Number

I am having a bad time trying to get a row number into a variable. I am
missing something very basic in my understanding.

I have the following code

Dim iRow As Integer

Columns("A:A").Select

Selection.FindNext(After:=ActiveCell).Activate


I can get to the first row I am in interested in, but I need to save the
actual row number in a variable. My next action is to do another search
to find a row further along. I will then have the 2 row numbers to
develop a selection I need.



Wes

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default Determining Row Number

Wes,

Your Find needs a What

Columns("A:A").Select
Selection.Find(What:="mywhat", After:=ActiveCell, _
LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:= _
False).Activate
myrow = ActiveCell.Row

repeat for myrow2

--
sb
"Wes Jester" wrote in message
...
I am having a bad time trying to get a row number into a variable. I am
missing something very basic in my understanding.

I have the following code

Dim iRow As Integer

Columns("A:A").Select

Selection.FindNext(After:=ActiveCell).Activate


I can get to the first row I am in interested in, but I need to save the
actual row number in a variable. My next action is to do another search
to find a row further along. I will then have the 2 row numbers to
develop a selection I need.



Wes

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Determining Row Number

Dim LngRow As Long

Columns("A:A").Select

' You need to do a find and specify what you are looking for before
' you do a findnext I believe.
Selection.FindNext(After:=ActiveCell).Activate

lngRow = ActiveCell.Row

When you are in VBA help looking at the Find method, you can look at the
code example for finding multiple instances (if you are using xl2000 or
xl97).

Regards,
Tom Ogilvy


"Wes Jester" wrote in message
...
I am having a bad time trying to get a row number into a variable. I am
missing something very basic in my understanding.

I have the following code

Dim iRow As Integer

Columns("A:A").Select

Selection.FindNext(After:=ActiveCell).Activate


I can get to the first row I am in interested in, but I need to save the
actual row number in a variable. My next action is to do another search
to find a row further along. I will then have the 2 row numbers to
develop a selection I need.



Wes

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



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
Determining row number in which a value occurs Harold Christian[_2_] Charts and Charting in Excel 1 February 17th 09 08:33 AM
Determining the highest number in a row Jaydubs Excel Discussion (Misc queries) 4 December 7th 05 03:10 PM
Determining the highest number in a row Jaydubs Excel Discussion (Misc queries) 1 December 7th 05 03:05 PM
Determining Active Row Number Don Guillett[_4_] Excel Programming 0 August 20th 03 11:04 PM
Determining Active Row Number Scott Patrias Excel Programming 0 August 20th 03 09:14 PM


All times are GMT +1. The time now is 04:09 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"