LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default I need the number of a row that meets my criteria

Hi, i need to make a sub find the row number of a cell that countains
specific value. This is the first part what is going to be a lon
function and this will help me define ranges.

here is the code.


Sub freq()
Dim IndexColumnlastRow As Long
Dim TimeOfDayToFind As String
Dim TimeOfDaysRowNumber As Single

Worksheets("frequency").Select

With Worksheets("frequency")
Range("b3").Select

IndexColumnlastRow = Cells(Rows.Count, "a").End(xlUp).Row

TimeOfDayToFind = ActiveCell.Offset(-1, 0).Value

End With

With Worksheets("zscore")

Range("a1:a16").Select
For Each cell In Selection
If cell.Value = TimeOfDayToFind Then
cell.Select
TimeOfDaysRowNumber = Application.WorksheetFunction.Row(cell)
End If
Next

End With

MsgBox IndexColumnlastRow
MsgBox TimeOfDayToFind
MsgBox TimeOfDaysRowNumber

End Sub

Any assistance is appreciated

--
Message posted from http://www.ExcelForum.com

 
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
if meets criteria add 1 r2rcode Excel Worksheet Functions 2 December 1st 09 09:38 PM
Add up a value that meets 2 criteria Lee Excel Discussion (Misc queries) 6 November 18th 08 09:38 PM
Do Nothing If Meets Criteria kmwhitt Excel Discussion (Misc queries) 2 September 20th 06 05:49 PM
how can i count a number that meets a criteria? oakm Excel Worksheet Functions 2 March 11th 05 06:13 AM
Max value that meets a criteria David Burr Excel Worksheet Functions 6 February 16th 05 01:31 PM


All times are GMT +1. The time now is 04:03 PM.

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

About Us

"It's about Microsoft Excel"