I have a worksheet to track projects. I want to move a row to a new worksheet when the project is complete. The completed project is based on wether a column cell has any data.I have attached the spreadsheet. Thanks in advance.
I have a worksheet to track projects. I want to move a row to a new worksheet when the project is complete. The completed project is based on wether a column cell has any data.I have attached the spreadsheet. Thanks in advance.
Hi Papa, welcome to the forum.
This macro will move all the rows on sheet Project List to the Complete sheet if there is a date in the Actual Completion column. Every time you run it, it will append the rows moved to the bottom of the projects already on the Complete sheet.
How to use the macro:Please Login or Register to view this content.
1. Open up your workbook
2. Get into VB Editor (Press Alt+F11)
3. Insert a new module (Insert > Module)
4. Copy and Paste in your code (given above)
5. Get out of VBA (Press Alt+Q)
6. Save your sheet
Last edited by JBeaucaire; 05-30-2009 at 11:05 AM.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
Thanks JBeaucaire. I have the VBA opened however it appears all of the editing features are transparent. What am I doing wrong? Is the spreadsheet locked out?
I moved everything to a new ws. It wprks if I go in to VBA and manually run the app. How do I make the macro run automatically?
It's not an automatic macro. You need to include in your list or requirements the thing you feel should "trigger" the macro if you want it to happen on its own.
I know, you're going to say "When I mark a row complete, it should move"...right? Well, use caution here. You don't think you could accidentally mark the wrong row? Stuff like this where you permanently move completed stuff to another sheet, i REALLY want to suggest you add a button to the top of your sheet so you can just click it to move the rows.
- Turn on the FORMS Toolbar.
- Click on Button icon and draw a button at the top of the sheet.
- The ASSIGN MACRO window will appear automatically
- Select the Completions macro you've already put in your sheet.
- Now edit the label on the button to "Archive Completions"
- Click on a blank part of your sheet to deselect the button
It's not ready to use and will run the macro any time you click it.
Will this be sufficient? That's how I would implement something like this.
Thanks for the response. For grins anf giggles I ran the macro without data in the field and got error 1004. I have a wee bit VB under my belt so I used the on error to jump around the code and end the sub. I figured out how to use keystrokes to start the macro. I'm using ctrl x to initiate the "macro" however the use of a button is cleaner. What I am working on now is trying to figure out how to automatically restore the auto filters automatically. Any thoughts?
If you're looking to learn more about VBA the best way to do it is just jump in and start flailing around trying to figure out new things. In this case -I'd start with the macro recorder.restore the auto filters automatically
Record a macro of you manually doing whatever it is you want to do, then tweak that code, and paste it onto the end of the macro you already have.
=IF(AND(OR(BLONDE,BRUNETTE,REDHEAD),OR(MY PLACE,HER PLACE),ME),BOW-CHICKA-BOW-WOW,ANOTHER NIGHT ON THE INTERNET)
My apologies, I thought the autofilters were in the original data on accident, so I included a line of code to remove them. In the macro I posted, take out this line:
...it's the last line before the end. Remove that.Please Login or Register to view this content.
EDIT:
Or better, yet, change it to this to just show all lines again:
That's better.Please Login or Register to view this content.
Last edited by JBeaucaire; 05-31-2009 at 05:50 PM.
We have a solution. Thank you for your help.
If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].
(Also, use the "scales" icon in our posts to leave Feedback, it is appreciated)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks