Private Sub Recalculate()
'Button added by Michael Rutz on 6/1/16 to recalculate values that are manually edited in the spreadsheet
Dim SearchPN As String
'Runs rows 7 through 47 through for loop
For I = 7 To 47
'Activates the start here tab then searches the cells in column 1 row i
Sheets("StartHereSubCom").Activate
'If cell value is not equal to nothing then run code
If Cells(I, 1) <> "" Then
'Sets value of SearchPN to column 1 row i value
SearchPN = CStr(Cells(I, 1).Value)
'Make SearchSheet Active
Sheets("Hidden2").Activate
'Insert SearchPN (copied from original)
Range("A4").Value = SearchPN
'Dim SearchCheck1 As String
'Dim SearchCheck2 As String
'SearchCheck1 = CStr(Range("A4").Value)
'SearchCheck2 = CStr(Range("A7").Value)
'If SearchCheck1 = SearchCheck2 Then
'If In_SearchPN.Value
If Range("A4").Value = Range("A7").Value Then
EditSubCom.Show
Else
MsgBox ("Part Number Not Found.") & vbNewLine & ("Please try your search again.")
SearchPN = ""
End If
End If
Next
Unload EditSubCom
Sheets("StartHereSubCom").Activate
End Sub
Private Sub Recalculate()
Dim f As Range
Set f = Sheets("StartHereSubCom").Range("A7:A47").Find(Sheets("Hidden2").Range("A7").Value, , xlValues, xlWhole)
If Not f Is Nothing Then
EditSubCom.Show
Else
MsgBox ("Part Number Not Found.") & vbNewLine & ("Please try your search again.")
End If
End Sub