I'm looking for help for a macro that can replace formulas that make my Excel file huge

K0st4din

Active Member
Joined
Feb 8, 2012
Messages
488
Office Version
  1. 2016
  2. 2013
  3. 2011
  4. 2010
  5. 2007
Platform
  1. Windows
Hi everyone I have a great excel workbook.
In the Cardio worksheet, I have formulas in several columns that take information from other columns and arrive at the desired end result.
My problem is that I don't know how to turn all this information that I do by hand into a macro that does it.
I will attach a sample table with an explanation and I hope it will be understandable. As if there are unclear things, I will cooperate.
In column B2:B, I have names, in column D2:D I have dates, in column J2:J, I have abbreviations, in column P2:P I have values of numbers with a plus sign (+) - >>> of all - described above, I take all the information to reach the following rows and columns, which are as follows: In cell AD1 -> start date, in cell AE1 - end desired date. In column AF2: I start listing each name in column B2:B (and the order is according to the number of codes in column AT2: to the end (how many), (as in the example BAY BOY KIL - 19 times, and so on for each subsequent name).
In column AG2: to the end I have a formula that gives me a result based on the formulas in column GA2:GZ2.
In column AI2: to the end I have a formula that gives me a result based on the formulas in column HB2:IA2.
The results I send in the example are 100% correct. But since I have to copy each name every month, then paste the exact number of codes, then put the formulas in the back columns and rows, and then my file becomes mega huge, a copy / paste special values so that the file can become much smaller again, and range GA2:GZ2, HB2:IA2 delete it completely to remove formulas and calculations to significantly reduce file size
At least I found this solution to get the right result, you may find it much easier. :)
So my idea is, can someone convert all these formulas to replace them with a macro to make my job easier.
Because the explanation is very long, I remain available to help if something is unclear. :)

test repeat name codes and total.xlsm

I apologize a lot, but with the proposed option to attach the sample table, it does not allow me, because the cells are more than 300 and I can only send you a link to google drive to download and view it.
 
Another setting ?‍♂️

Before running the macro you must delete all formulas and data from columns AF to AI
Consider this macro:
Hello DanteAmor,
i think i have a doubt where the problem might be coming from (if you were able to look at the last problem file).
I have the feeling that when I set the period between the two dates, I have people (in column B2: B), sometimes certain names are not in the selected period and maybe that's why he gives me this error - but that's just a guess.
I hope you have free time and if you can look at the error.
Thank you again and again because I can't handle it.
 
Upvote 0

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,215,020
Messages
6,122,712
Members
449,093
Latest member
Mnur

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