View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Need some help with excel

Public Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim dato As Date, DatoAug As Date

dato = Format(Now, "mm-dd-yy")
DatoAug = Format("08-30-2006")

With Target

If .Column < 1 Then Exit Sub
If dato < DatoAug Then Exit Sub

Application.EnableEvents = False
Range("F5").Value = Application.Sum(Range(Target, Range("A5")))
Application.EnableEvents = True

End With
End Sub



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"San" wrote in message
oups.com...
Public Sub Worksheet_Change(ByVal Target As excel.Range)


Dim dato As Date, DatoAug As Date

dato = Format(Now, "mm-dd-yy")
DatoAug = Format("08-30-2006")



With Target

If .Column < 1 Then Exit Sub
If dato < DatoAug Then Exit Sub

Application.EnableEvents = False
Range("F5").value = Application.Sum([Target:A5])
Application.EnableEvents = True

End With
End Sub


This formular obviously doesn't work...but since i'am noob I don't know
why. The targeted cell(If .Column < 1 Then Exit Sub) has to be collum
A otherwise it will exit sub(this part works. So the problem is that I
cannot SUM the targeted(this value is A5 to infinitive) with cell A5.

Many thx for any help