COUNTIF Macro

tatendatiffany

Board Regular
Joined
Mar 27, 2011
Messages
103
My PC is running out of resources because i have used multiple countif, sum statements for dynamic ranges and i am trying to use macros instead :

e.g.

=SUM(OFFSET(KTPT81T!G5,0,0,COUNT(KTPT81T!G:G)))

the data orginates from sheet 126 and i need the sum to be displayed in sheet 1 column Y2. Please help me

and =COUNTIF(TABF10!$F:F,"Y") for a countif statement

Many Thanks
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Do not reference entire columns. Unless you know that you are going to be getting around 65000 rows of data ( or worse, if you are in Excel 2007+ format, 1048576 rows of data ) .... do you have an estimate of the maximum possible extent of your data?
 
Upvote 0
Thanks again fro replying, the thing is the range is going yo be dynamic and data will be continually added to the table, so ideally it should be from range G:G or H:H depending on the column. I am using excel 2007

Thanks again:)
 
Upvote 0
Are you saying that you have no idea of the maximum number of entries?

How many entries are there now? How much has your range increased during the last month?
 
Upvote 0
Right now the column has data up to G50, the data entries will vary no more than 10 every month but i want it to be dynamic so it automatically updates when there changes are made.

Thank you:)
 
Upvote 0
So a range of 1000 rows would be sufficient then?

Change ALL of your entire column references to reference ranges up to row 1000 instead. ( or even 2000, or 5000, if you think 1000 isn't enough ). This will be a massive improvement and should remedy your resources problems.
 
Upvote 0
I have changed it but its still saying running out of resuorces, what else couldo i do (i think i forgot to mention) i have 28 worksheets i have to do the same to and they all have different ranges H:KL. i dont know what else to change someone had told me using macros is faster and fixes the problem

Thank you:)
 
Upvote 0

Forum statistics

Threads
1,224,591
Messages
6,179,769
Members
452,941
Latest member
Greayliams

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top