Consulting

Results 1 to 2 of 2

Thread: Solved: Worksheet Change...

  1. #1

    Solved: Worksheet Change...

    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.

    [VBA]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
    [/VBA]

  2. #2
    Application.EnableEvents = False


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •