Thursday, 15 May 2014

excel - sumifs using range cell - error 1004 -


I need your help.

If I am running this code, then there is no problem (note the sheet 1.ange ("F2: BL6991")

  column = sheet 2. range ("A1"). End (xltorite). Column 'for the MSBBbox (colonumber) J = 3 for the column for the I = 2, the ronemember sheet 2. Seals (i, j). Value = application Worksheet function. SUMIfs (Sheet 1. range ("F2: BL6991"), Sheet 1. Category ("E2: E6991"), Sheet 2.Cells (i, 1)) Next I Next   

But when I try to change this code: (I change my code from Sheet1.Range ("F2: BL6991") for Sheet 1. Category (Cells (2, J + 3) , Cells (6991, J + 3))

  column = sheet 2. category ("A1"). End (xltorit) column 'msblogbox ( Columbar) for Jammu = 3 for the column I = 2 to the daily sheet 2. Seals (i, J) Value = Application Worksheet Function SMIFs (Sheet 1. Range (Cells (2, J + 3), Cells (6991, J + 3), Sheet 1. Range ("E2: E9 9 1 "), Sheet 2. Seals (I, 1)) Next Me next which   

I got 1004 error.

Even when I < Code> << Pre> sheet 1.ange (cells (2,6), cells (6991, 6))

or error using this code Also found:

  sheet 2.kel (i, j) value = varResult varResult = Application.WorksheetFunction.SUMIfs (_ Arg1: = Sheet1.Range (cell (2, 6), to Learn (691, 6)), _ Arg2: = Sheet1.Range ("E2: E6991"), _ Arg3: = Sheet2.Cells (i, 1))   

Can you guide me where I do wrong and how to fix it?

TIA

Your main problem is that SUMIF

  SUMIF (category, criteria, [sum_range])   

This will work:

  range range as 1 range set range 1 Set range 1 = worksheet ("sheet 1"). Range ("F2: BL6991") Colnumber = Sheet2.Range ("A1"). End (xltorite). I = 2 to 10 set for the column column for J = 3 = worksheet ("Sheet2"). Cell (i, 1) sheet 2.class (i, j). Value = App Worksheet Function. SumIf (Category 1, Bet) Next I Next j    

No comments:

Post a Comment