Tricky macro split data and insert lines then formulas

liquid24

New Member
Joined
Aug 28, 2015
Messages
2
Hello,

I have an issue with a macro I was given. It's basically crap/unusable so I'd like to start fresh. Considering that others will have to use this macro as well I need to add some prompts to ensure that they don't mess up.


Here's what the data looks like
1-01-01+
1-01-02/03+
1-01-04-
1-02-01/02+
1-02-02/03-
1-02-03+
1-03-01/02+
1-03-03/04-
Etc.

Ok my data is in fileA
FileB is the template file I'll use over and over.
1) prompt to open fileA
2) prompt to user to select data needed (H3&I3 until the last cell with data, sometimes with gaps)
3) prompt to bqck to file B
4) paste data in fileB (C6)
5) scan C6 and every row until the end with following if's
- if the 2nd, 3rd, or 4th character from left is "-"
-Then check if cell below left 4 characters match cell paste value (C7 = 1-01-02/03 & C8 = 1-01-04)
-If not insert 3 rows below last value (C8= 1-01-04 & C9 = 01-02-01/02 , insert 3 rows under c8

Repeat till end

6) place data in row above data first one would be A5 since data starts in C6 (left 4,or 5,or 6 characters in C6.
Ex if C18 ="1-04-01" has data then place 1-04 in A17
7) other equations (countifs, max, sume of section between blanks.

I know this is kind of a lot, I have some of the code written but its been a while since I had to anything this complicated. Thank you in advance to anyone who can help.
 
Last edited:

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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