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.
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: