How do ressolve this auto-sorting macro issue?

How do ressolve this auto-sorting macro issue?

Hi, I posted the below in a thread yesterday, and was amazed how quick you got back to me:

Hi,

I am having a bit of trouble on this same issue.

in my spreadsheet columns A-C are sorted in desending order based on the value of Column A. I would like the sheet to re-sort when the values in column A change. Im not sure if its important or not but when the value in column A changes then column B changes accordingly.

i Pasted the code from above and modified it:

REM sheet module
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = false
On Error Goto ENEV
REM add your code below
'Msgbox "Target.Address:" & Target.Address '
if (Target.Address = "$A$1:$C$100") then 'Replace the total rage of webdata
Target.Sort Key1:=Range("A3:A100"),Order1:=xlDescending,Header:=xlNo,MatchCase:=true,Orientation:=xlTopToBottom
'Replace the range which is used to sort in the key1
end if
ENEV:
Application.EnableEvents = true


and i get the following error message:

Encountered "<EOF>" at line 20, column 1.Was expecting one of:
<ENDSUB>,  <IDENTIFIER>,  <DOT>,  "SET",  "LET",  "CALL",  "IF",  "DIM",  "REDIM",  "FOR",  "DO",  "WHILE",  "CONST",  "STATIC",  <SELECTCASE>,  "WITH",  <EXITFUNCTION>,  <EXITSUB>,  <EXITDO>,  <EXITFOR>,  "END",  <ONERROR>,  "GOTO",  <REMARK>,  "<%%>",  "<%=%>",  <NL>,  ":", 

This is a different language to any i know and im well and truely lost!
Any help would be amazing.

dan


Abinaya got back to me and told me that id missed the end sub line so i put that in and edited my table, the new macro i have been trying to enter reads like this:

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = false
On Error Goto ENEV
REM add your code below
'Msgbox "Target.Address:" & Target.Address '
if (Target.Address = "$A$1:$C$100") then 'Replace the total rage of webdata
Target.Sort Key1:=Range("A3:A100"),Order1:=xlDescending,Header:=xlYes,MatchCase:=true,Orientation:=xlTopToBottom
'Replace the range which is used to sort in the key1
end if
ENEV:
Application.EnableEvents = true
End Sub

I enter this in the VBA editor (in the macro modules and sheet 1 sections) and it still does not work, and furthermore, if i click run macro i get the message 'no macros found'

Any help would be greatly apprieciated.

Dan