mangisqa
08-02-2011, 07:32 AM
I am having issues ending my following code and keep getting End with or Block If errors.
I am trying to have a message box pop up if a value is found and if they click yes- then the list is sorted to show that value. If they click no, it simply disappears
Dim intRows As Integer
If Target.Column = 9 Then 'Error check only fires if Column 9 (I) is edited, else exit sub
For intRows = 5 To 17000 'Error check only fires if Rows 5 to 47 are edited, else exit sub
If Cells(intRows, Target.Column) = "New Cast Member" Then
MsgBox "You have New Cast Members. Do you want to view New Cast Members", vbYesNo, "[New Cast Member Alert]"
If intResponse = vbYes Then
ActiveSheet.Range("$A$4:$K$17000").AutoFilter Field:=9, Criteria1:="New Cast Member"
ActiveWorkbook.Worksheets("Paste Full Report Here").AutoFilter.Sort.SortFields. _
Clear
ActiveWorkbook.Worksheets("Paste Full Report Here").AutoFilter.Sort.SortFields. _
Add Key:=Range("A4:A17000"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortTextAsNumbers
With ActiveWorkbook.Worksheets("Paste Full Report Here").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End If
Else: Exit Sub
End Sub
Thanks for any help!
I am trying to have a message box pop up if a value is found and if they click yes- then the list is sorted to show that value. If they click no, it simply disappears
Dim intRows As Integer
If Target.Column = 9 Then 'Error check only fires if Column 9 (I) is edited, else exit sub
For intRows = 5 To 17000 'Error check only fires if Rows 5 to 47 are edited, else exit sub
If Cells(intRows, Target.Column) = "New Cast Member" Then
MsgBox "You have New Cast Members. Do you want to view New Cast Members", vbYesNo, "[New Cast Member Alert]"
If intResponse = vbYes Then
ActiveSheet.Range("$A$4:$K$17000").AutoFilter Field:=9, Criteria1:="New Cast Member"
ActiveWorkbook.Worksheets("Paste Full Report Here").AutoFilter.Sort.SortFields. _
Clear
ActiveWorkbook.Worksheets("Paste Full Report Here").AutoFilter.Sort.SortFields. _
Add Key:=Range("A4:A17000"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortTextAsNumbers
With ActiveWorkbook.Worksheets("Paste Full Report Here").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End If
Else: Exit Sub
End Sub
Thanks for any help!