Forum Discussion
ASB_98Brazil
Dec 07, 2018Copper Contributor
Macro VBA
How to exclude intervals with 10, 11, 13, 15, 16 and 17 consecutive lines, repeated several times in a column, where the first line always starts with "TOTAL ACCUMULATED *" and the last one always en...
ASB_98Brazil
Dec 08, 2018Copper Contributor
Good morning mate,
I am a beginner in VBA. I was unable to edit the code to exclude line breaks that start with "TOTAL ACUMULADO DAS *" and end with "Base INSS: *", for example "A18: A28" and "A50: A60" with 11 lines to be A1412: A1426 with 15 rows to be deleted, "A2084: a2100" with 17 rows to be deleted, and "A2729: A2740" with 12 rows to be deleted. I've attached the example worksheet so you can mirror it. The array would stay (11, 12, 13, 15, 17).
erol sinan zorlu
Dec 09, 2018Iron Contributor
hello,
what you can do is to create a two dimensional array where the first value is the string you search and the second one is the number of cells to be eliminated. then with a for loop you need to search in the first column the string part and then delete the number of rows that is in the same array.
finding the value can be done with excel built in functions like find or findall
- ASB_98BrazilDec 09, 2018Copper ContributorDear friend,I'm here in Teresina-PI Brazil, I'm a beginner in VBA Excel. As I attached the spreadsheet template, could you please edit all the VBa code in the macro for me? I'd be very grateful for that kindness.
- erol sinan zorluDec 10, 2018Iron Contributor
well I do not have a code that does a similar thing readily at hand. So I need to write it which takes some time. I cannot promise but I will try to write it in my free time.
- ASB_98BrazilDec 10, 2018Copper Contributor
OK! Friend,
I will await your response. And thank you for your attention.