BravesPiano5
03-21-2013, 09:11 AM
Below is the code written to allow the user to enter specific data into a cell and the macro automatically filter data/spreadsheet according to what the user specificed.
My problem is that I want at the end of the macro for the cell to change back to "Enter Desirable"...when I try to just assign the range the value, the worksheetchange starts a never ending loop. :(
Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Target.Worksheet.Range("B2")) Is Nothing Then
Range("B2").NumberFormat = "$#,##0.00"
With ActiveSheet
On Error Resume Next
If .AutoFilterMode = True Then .ShowAllData
On Error GoTo 0
Rows("5").AutoFilter Field:=14, Criteria1:=Range("B2").Value
End With
End If
'Filters the spreadsheet for the rate entered
Range("B2").Select
End Sub
My problem is that I want at the end of the macro for the cell to change back to "Enter Desirable"...when I try to just assign the range the value, the worksheetchange starts a never ending loop. :(
Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Target.Worksheet.Range("B2")) Is Nothing Then
Range("B2").NumberFormat = "$#,##0.00"
With ActiveSheet
On Error Resume Next
If .AutoFilterMode = True Then .ShowAllData
On Error GoTo 0
Rows("5").AutoFilter Field:=14, Criteria1:=Range("B2").Value
End With
End If
'Filters the spreadsheet for the rate entered
Range("B2").Select
End Sub