All right, I normally don't post OT items as this is a Michigan SPORTS blog but my general inability to succeed with finding help elsewhere in the world that Google allows me to connect to has left me with little choice.
I'm currently working on writing an Excel macro to make my life easier. Hopefully, if everything works out properly, writing reports at work will be significantly faster. The thing is, I have no experience with VBA and I'm having some problems that I'm hoping the MGoBoard can help me with. Believe me when I say that I've tried my best to Google myself some answers but I've been thus far unsuccessful.
What I need to do is look at a range of cells and determine if the entries in column A fall into one of 3 categories which, for simplicity, we'll call cat1, cat2, or cat3. Every cell will be in one of those categories. Based on that, I need to copy columns A-C of all the rows that have cat1 data in their column A cells to a sheet that we'll call sheetcat1. I need to do the same thing cat2 and cat3- sending them to their own respective sheets.
I've written code that can succeed at copying entire rows over from the master sheet to the specific category sheets. So, the only problem is that I don't want the entire row to copy over as that will get rid of the other formulas that are currently in columns D-X in sheetcat1, sheetcat2, and sheetcat3. I did so with a moderate amount of modification to the second set of code shown here.
To adapt my current code to what I need it to do is somehow tell Excel to not select the entire row during the proper "For" loop but instead just select columns A-C. In the link I posted, that would be changing the "Set MyRange1 = c.EntireRow" (and the other similar "Union" line below that) so that the range that's being set for "MyRange1" is just columns A-C in row c.
This seems very simple but I just can't figure it out. Any help would be appreciated (that appreciated manifested through points). Again, I know that this isn't the best place for this but I figure there must be some CE majors on here that can help an old ChemE major alumnus remember some coding that he's forgotten over the years. Besides, what else do we have to talk about since we're not really discussing expansion possibilities?
Edit: I was able to heavily modify the code from the link I gave and now it works just fine. Thanks to MCalibur for the assist.