Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Excel Macro - multi step, delete based on value, subtotal, concatenate the 2nd character

Posted on 2015-01-21
10
Medium Priority
?
195 Views
Last Modified: 2015-01-23
Hello:

I need help with a macro that already has a lot of action, but needs more.   I am attaching a sample.   In my sample I need to search column J and clear anything in it that does not begin with an E, if I clear that cell, I also need to clear the corresponding cell in F.  this will need to loop thru until there is no more data in C.  

Next I need to subtotal the F's  based on a change in C and put the result in G on what would be the first line of data for that subset.  In my example G2, G6, G9, etc will have the subtotals.  (if it is easier and this all goes on a bottom line, I can fill the remaining columns down)

Then I need to use the concatenate function to pull the 2nd character from groups the J cells and also put it on the first line of the subset.   Line 2 is what it is supposed to look like.

All this will need to loop thru until there is no more data.  Line A,  B and C will be full of data until the end.  

You will notice there will be some lines where people do not have anything in G or J - this is correct and will happen throughout the spreadsheet.  

I know this is a lot to ask, but I know there are some awesome excel people on this forum, so I'm shooting the moon.  

THANKS ahead of time for any effort you make on this.
Jen
sample-data.xlsx
0
Comment
Question by:jenit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 49

Expert Comment

by:Martin Liss
ID: 40563017
I can probably create the macro for you from scratch, but you seem to be saying that you have a macro that does some of it, but as the file you posted is xlsx format, all macros were removed.
0
 

Author Comment

by:jenit
ID: 40563060
Sorry I was unclear.  The macro I'm talking about has already gotten the sheet to this point.  I don't have a macro that does any thing after the sheet looks like this.
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 40563084
OK, no problem. Be back soon.
0
Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 

Author Comment

by:jenit
ID: 40563130
that is awesome
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 40563160
Run the "Multi" macro in the attached workbook. I not sure at all that I got what goes in column K correct so please explain further.
Q-28601215.xlsm
0
 

Author Comment

by:jenit
ID: 40563276
Wow, that is a great start.  The sub totals work perfectly.  I'm excited as I have another worksheet I will be able to use that on as well.

K column needs to have the 2nd character of each cell in the set (before a change in C).  EL is the result that is returned below, it should be MDVL
EMEO      EL
EDES      
EVES      
ELES      

I have to sign off for the night for kid activities.  But will be back at it early tomorrow.  THANKS for your help on this.
0
 
LVL 49

Accepted Solution

by:
Martin Liss earned 2000 total points
ID: 40563314
Ok, that explanation helps.
Q-28601215a.xlsm
0
 

Author Closing Comment

by:jenit
ID: 40564204
I would give you an A+ if I could.  That is truly awesome!   The only funky is it puts extra characters in K if there was no data in J, it continues to enter the characters from the LAST calculated entry -  I'm not concerned with that as I'll add to the macro a function to find and clear those cells.   This works Perfect for what I am doing.  

Thanks, each time I use this forum for a new macro, I gain experience and code that I can use in other situations.  

Your response was right on target and so quick - a BIG THANKS!
Jen
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 40564442
Try this.
Q-28601215b.xlsm
0
 

Author Comment

by:jenit
ID: 40566386
That does it.  Thanks again for all your help.   To all who are interested in this macro - it is clean and does some great things.

It will subtotal and put the result in a different column
It will pull the 2nd character out of a string and create a new value with those characters until it sees a blank, then it starts again.  
It will clear cells based on a specific character and also clear their corresponding cells a few columns over.
0

Featured Post

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question