Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 62
Default Finding Number Inside a Cell

Note here that with Rick's solution, I hadn't put in conditional
formatting yet.
This is really quite easy, the tough part was getting the max/min (or
high/low) to get a correct readout.

I still need to sit down and look at the code to understand it. Maybe
I'll try to think of some similar type program to write and try out to
test myself afterwards. Regardless, in the future a question or two
may come, but for now, here's Rick's solution laid out.

------ Rick's SOLUTION Style --------
Sub RCVV_WP()


Dim TeishutsuItemRow As Long
Dim TeishutsuItemColumn As Long
Dim PrevXTIR As Long
Dim PrevYTIR As Long
Dim PrevLTIR As Long
Dim SokuteiPointNumber As Long
Dim HighestPointNumber As Long
Dim SolutionTolerance As Long
Dim ToleranceString As String
Dim ToleranceValue As String
Dim LValueBase As String
Dim TempLoop As Long
Const Separator1 = "/"
Const Separator2 = "¡Ó"
Const StanleyText = " ST "
Const NumericCharacters = "+-0123456789"
Dim Position As Integer
Dim High As String
Dim Low As String



' SET THE VARIABLES FOR TEISHUTSUROW AND COLUMN.
' ALSO SET PREVIOUS X,Y,L ITEM ROWS IN THE EVENT REPEATED (BLANK)
TOLERANCE ENTRY.
' SOKUTEI AND HIGHEST POINT NUMBERS SET TO 1.
TeishutsuItemRow = 3
TeishutsuItemColumn = 8
PrevXTIR = 0
PrevYTIR = 0
PrevLTIR = 0
SokuteiPointNumber = 1
HighestPointNumber = 1

For TempLoop = 3 To 300
If Sheets("´£¥X¥Î").Cells(TempLoop, TeishutsuItemColumn + 1).Value
HighestPointNumber Then
HighestPointNumber = Sheets("´£¥X¥Î").Cells(TempLoop,
TeishutsuItemColumn + 1).Value
End If
Next TempLoop

'MsgBox "HighestPointNumber = " & (HighestPointNumber)

' LOOP FOR ALL SOKUTEI POINTS.
Do Until SokuteiPointNumber = HighestPointNumber + 1

' RESET VALUES FOR TOLERANCE
ToleranceValue = ""


' FIRST MATCH UP SOKUTEI POINT WITH ROW ON ´£¥X¥Î SHEET, AND SOLVE FOR
XYL TOLERANCES.
For TempLoop = 0 To 2

ToleranceString = Sheets("´£¥X¥Î").Cells(TeishutsuItemRow,
TeishutsuItemColumn + 2 + TempLoop).Value

MsgBox "ToleranceString = " & (ToleranceString)

High = MaxTol(ToleranceString)
Low = MinTol(ToleranceString)

MsgBox "High = " & (High)
MsgBox "Low = " & (Low)

Next TempLoop


Loop

End Sub

Function MaxTol(VarTol As String) As Variant
Dim Parts() As String
On Error GoTo BadFormat
If VarTol Like "* [Ss][Tt] *" Then
MaxTol = CDbl(Split(VarTol, "ST", , vbTextCompare)(1))
Exit Function
End If
If VarTol Like "* ¡Ó*" Then
Parts = Split(VarTol, "¡Ó")
MaxTol = CDbl(Parts(0)) + CDbl(Parts(1))
Exit Function
End If
If VarTol Like "* */*" Then
MaxTol = CDbl(Split(VarTol)(0)) + CDbl(Split(Split(VarTol)(1), "/")
(0))
Exit Function
End If
BadFormat:
MaxTol = "#BADFORMAT!"
End Function


Function MinTol(VarTol As String) As Variant
Dim Parts() As String
On Error GoTo BadFormat
If VarTol Like "* [Ss][Tt] *" Then
MinTol = CDbl(Split(VarTol, "ST", , vbTextCompare)(1))
Exit Function
End If
If VarTol Like "* ¡Ó*" Then
Parts = Split(VarTol, "¡Ó")
MinTol = CDbl(Parts(0)) - CDbl(Parts(1))
Exit Function
End If
If VarTol Like "* */*" Then
MinTol = CDbl(Split(VarTol)(0)) + CDbl(Split(Split(VarTol)(1), "/")
(1))
Exit Function
End If
BadFormat:
MinTol = "#BADFORMAT!"
End Function



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
Finding Cell that changes from a Positive to a Negitive number tpeter Excel Worksheet Functions 2 December 12th 07 06:27 PM
Sum x number of right cells after finding first cell more than 0. Learn Excel Worksheet Functions 4 December 9th 07 04:57 PM
Finding the Row number based on contents of a cell Chris Youlden Excel Worksheet Functions 5 September 6th 07 04:38 PM
finding a particular cell in another worksheet whose row number ch Andrew Excel Discussion (Misc queries) 1 September 12th 05 01:36 PM
Page Number inside Cell? mae1778 Excel Discussion (Misc queries) 3 August 13th 05 09:34 PM


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