Need to write a macro to copy a row of information if true
Solved/Closed
lrjupiter
Posts
5
Registration date
Friday December 19, 2014
Status
Member
Last seen
December 22, 2014
-
Dec 19, 2014 at 01:26 PM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - Dec 22, 2014 at 06:42 PM
vcoolio Posts 1411 Registration date Thursday July 24, 2014 Status Moderator Last seen September 6, 2024 - Dec 22, 2014 at 06:42 PM
Related:
- Need to write a macro to copy a row of information if true
- How to write & in laptop - Guide
- How to delete a row in a table in word - Guide
- Saints row 2 cheats - Guide
- How to write pi on keyboard - Guide
- How to write e with accent - Guide
1 response
vcoolio
Posts
1411
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
September 6, 2024
262
Dec 20, 2014 at 11:19 AM
Dec 20, 2014 at 11:19 AM
Hello Irjupiter,
I'm not sure how your workbook is set out but have a look at the following link:-
https://www.dropbox.com/s/3p65onfgjr68r7a/IrJupiter.xlsm?dl=0
I have created a work book with five sheets with tab names for the years 2013, 2014, 2015, 2016 with the first sheet named "Projects" just to see if its what you had in mind. The first sheet I named "Projects" as I assumed that this would be your Master sheet with all your project data going into this sheet and then dispersed to the other sheets by year. The dates in the "Projects" sheet are all mixed up just as a test for the code. I also assumed that there are older project details in the "Projects" sheet that you no longer have any interest in and which will stay behind once the other project details are transferred to their respective sheets. So for this purpose, I have included a "Sort" button which will tidy up the "left overs" for you until you decide what to do with them. Click on the "Transfer Data" button first, then the "Sort" button.
I hope this is what you had in mind.
Kind regards,
vcoolio.
I'm not sure how your workbook is set out but have a look at the following link:-
https://www.dropbox.com/s/3p65onfgjr68r7a/IrJupiter.xlsm?dl=0
I have created a work book with five sheets with tab names for the years 2013, 2014, 2015, 2016 with the first sheet named "Projects" just to see if its what you had in mind. The first sheet I named "Projects" as I assumed that this would be your Master sheet with all your project data going into this sheet and then dispersed to the other sheets by year. The dates in the "Projects" sheet are all mixed up just as a test for the code. I also assumed that there are older project details in the "Projects" sheet that you no longer have any interest in and which will stay behind once the other project details are transferred to their respective sheets. So for this purpose, I have included a "Sort" button which will tidy up the "left overs" for you until you decide what to do with them. Click on the "Transfer Data" button first, then the "Sort" button.
I hope this is what you had in mind.
Kind regards,
vcoolio.
Dec 22, 2014 at 08:21 AM
Dec 22, 2014 at 09:00 AM
Dec 22, 2014 at 09:09 AM
Once you download the DropBox link, go to the Developer tab in the ribbon. Over on the far left, click on Visual Basic. Here, the code field opens. On the far left, double click on Module1. In the large white field that then opens, you will see the code. In the code, wherever you see the line:-
rng.EntireRow.ClearContents
just delete it (there should be four such lines of code). Sheet1 details will then be left as is. Be aware, though, that if you remove the above line of code, the transferred entries will duplicate each time you transfer data. However, you can remove duplicates simply by going to the Data tab, select the Data Tools group and select "Remove Duplicates". You will need to highlight the whole range of data so just drag your cursor across the letters at the top of the sheet which will highlight the entire columns you wish to deal with. In the dialogue box that opens, leave all the boxes ticked and click OK.
The "sort" code is in module2. This still may come in handy for you so just leave it as it is and use it if you choose to.
Just copy the amended code to your actual work book when you are ready to do so but play with it first in the link just to make sure its what you are after. Remember to change all sheet names in the code to match exactly to your tab names.
Regards,
vcoolio.
Dec 22, 2014 at 09:52 AM
Dec 22, 2014 at 10:35 AM