![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 29
|
This code keeps stopping at the line
HPress = PS105.Row I have similiar code in another module and it works fine. What am I not seeing? Sub Velocity() Dim RngeCell Dim Found95 Dim PT95 Dim OpnRng Dim MaxPt Dim LastRow Dim PS105 Dim HPress ' Locate 95 point Range("C1").Select For Each RngeCell In Range("C2:C4000") If RngeCell.Value > 95 Then Set Found95 = RngeCell: Exit For End If Next Found95.Select PT95 = Found95.Row ' Locate 105 Point Range("C" & PT95).Activate Range(Selection, Selection.Offset(200, 0)).Select OpnRng = Range(Selection, Selection) MaxPt = Application.WorksheetFunction.Max(OpnRng) With Worksheets(1).Range(Selection, Selection) Set PS105 = .Find(HighPt, LookIn:=xlValues) HPress = PS105.Row End With MsgBox HPress End Sub |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
worked fine for me
|
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Kobe, Japan
Posts: 1,420
|
Hi!
Pls change OpnRng = Range(Selection, Selection) to Set OpnRng = Range(Selection, Selection) And I would think you don't have to select ranges to run this like this.
_________________ With regards, Colo [ This Message was edited by: Colo on 2002-04-29 19:55 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|