View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
San[_2_] San[_2_] is offline
external usenet poster
 
Posts: 17
Default Referring to a cell(Newbie)


Gary Keramidas wrote:
i'm not sure what you're looking for.
do you want a sum formula in E4?

Sub test()
Range("e4").Formula = "= sum(c10:c1)"
End Sub



Not exactly...I have 2 collums B and C. I have the date on B and the
amont of items made in collum C. So everyday i type my initials in
collum A and the date automaticly pops up in collum B. And then I type
in collum C how many items i have made that given day. But at the end
of the month i don't what cell in collum B i'll end up in. I want to
know how i can find out which cell it is, cause I need to sum the cell
next to which is C?? Basicly I want to sum the amount of items i have
made that month...which vary.

I am so bad at explaining this! Partly because I don't Excel or VBA
very well :(



Public Sub Worksheet_Change(ByVal Target As excel.Range)

On Error GoTo ErrorHandler

Dim dato As Date
Dim DatoAug As Date, DatoSept As Date, DatoOkt As Date, DatoNov As
Date, DatoDec As Date



dato = Format(Now, "mm-dd-yy")
DatoAug = Format("08-31-2006")
DatoSept = Format("09-30-2006")
DatoOkt = Format("10-31-2006")
DatoNov = Format("11-30-2006")
DatoDec = Format("12-31-2006")




With Target
If .Count 1 Then Exit Sub
If .Column < 1 Then Exit Sub

Application.EnableEvents = False
.Offset(0, 1).Value = Format(Now, "mm-dd-yy")
Application.EnableEvents = True

End With


If dato = DatoAug Then


[E4].Value = Application.Sum([???:C1])

At the end of the month I would like to sum collum C so I get the
amount of items for that given month. In clolum B I have the date.