Quick VB Help

Hi, its been quite awhile since i've used visual basic and i find myself stuck trying make a macro to search a column full of dates, and as long as theres a date there, proceed to check a column using the WEEKDAY function if its a sunday, and if so create a cell that adds up an arbitrary figure from mon-sun the previous week.

I tried:

Sub SetTotal()
i = 1
Do While Cells(A, i) <> 0
If Cells(E, i) = 1 Then
j = i - 6
Cells(C, i) = "Weekly"
Cells(D, i) = Worksheets("Sheet1").Sum(D, j),(D, i)
End If
i = i + 1
End Sub

But i'm pretty sure my syntax is completely messed up in my reffering to the cells and i dont think thats the right way to add up a range of numbers.... Any help in this matter would be greatly appreciated!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!