I have a problem wiht a small vba code:
The simple sum formula ( to test my code) needs to be replaced by the large sumif formula and I can't get it to work. Don't know why?
thanks for the help again.
Rich (BB code):
Sub Print_All_Items()
Dim itemrange As Range
Dim itemcounter As Integer
Worksheets("VOLUMES").Activate
Worksheets("VOLUMES").Range("ITEMS").Select
Selection.Copy
Worksheets.Add
With ActiveSheet
.Paste
.Name = "Printout"
End With
Set itemrange = Range("A1").CurrentRegion
itemcounter = itemrange.Rows.Count
Range("C1").Select
For i = 1 To 3
Cells(i, 3).Formula = "=sum(1+1)" this formula is to be replaced by the large sumif formula
Next i
Range("C1").Formula = "=SUM(IF(DATABASE!$E$4:$AJ$10000=Printout!A1;(DATABASE!$C$4:$C$10000)*(DATABASE!$F$4:$AJ$10000)))"
The simple sum formula ( to test my code) needs to be replaced by the large sumif formula and I can't get it to work. Don't know why?
thanks for the help again.