Hi all
I have this great code which copies a value based on text in a row; however I would like to alter it to only copy rows is a value within the text if over 40
Eg: there are rows that have text "ALTTT", then also have a number in the text like: "ALTTT .000 D."
How would I alter my code to only copy that rows if the "ALTTT" value is more the "40.00 D"
Sub test()
Dim myAreas As Areas, myArea As Range, x, r As Range
With Sheets("Source")
With .Range("a1", .Range("a" & Rows.Count).End(xlUp)).Offset(, 1)
.Formula = "=if(iserror(find(""++"",a1)),1,"""")"
Set myAreas = .SpecialCells(-4123, 1).Areas
.Clear
End With
End With
For Each myArea In myAreas
x = Application.Match("*ALTTP*", myArea.Offset(, -1), 0)
If IsError(x) Then
x = Application.Match("*ALTTT*", myArea.Offset(, -1), 0)
If IsNumeric(x) Then
x = Application.Match("*Teacher*", myArea.Offset(, -1), 0)
If IsNumeric(x) Then
If r Is Nothing Then
Set r = myArea(x, 0).Resize(2)
Else
Set r = Union(r, myArea(x, 0).Resize(2))
End If
End If
End If
End If
Next
If Not r Is Nothing Then r.Copy Sheets("8% Calculations required").Cells(1)
End Sub
Bookmarks