Auto-copy of select rows to another worksheet
Solved/Closed
Big.Moe
Posts
32
Registration date
Tuesday March 13, 2012
Status
Member
Last seen
March 19, 2012
-
Mar 13, 2012 at 01:54 AM
Big.Moe Posts 32 Registration date Tuesday March 13, 2012 Status Member Last seen March 19, 2012 - Mar 18, 2012 at 05:31 PM
Big.Moe Posts 32 Registration date Tuesday March 13, 2012 Status Member Last seen March 19, 2012 - Mar 18, 2012 at 05:31 PM
Related:
- Excel vba copy rows to another worksheet based on criteria
- Transfer data from one excel worksheet to another automatically - Guide
- Number to words in excel formula without vba - Guide
- Vba case like - Guide
- How to open vba in excel mac - Guide
- Excel marksheet - Guide
8 responses
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Mar 16, 2012 at 12:27 AM
Mar 16, 2012 at 12:27 AM
why not just autofilter jan 12 sheet field column M and cirtieria blank
and copy filtered data to feb 12 sheet for which the macro is below
in each month end you have to change the sheet names in the macro and run the macro
the file with feb12 filled can be downloaded from
http://speedy.sh/Rdnaj/big-more-Tracking-List2.xlsm
one suggestion for permanent attention. If you want to write a macro
DO NOT make cosmetic changes to the sheets like coloring,merging, changing font etc. These cosmetic changes should be done only at the last stage that is just before presenting to your boss or users. Otherwise the writing macro becomes little more difficult and complicated. Keep this in mind.
The macro is in the module and is also repeated herer
if you want to retest run undo and then "test"
and copy filtered data to feb 12 sheet for which the macro is below
in each month end you have to change the sheet names in the macro and run the macro
the file with feb12 filled can be downloaded from
http://speedy.sh/Rdnaj/big-more-Tracking-List2.xlsm
one suggestion for permanent attention. If you want to write a macro
DO NOT make cosmetic changes to the sheets like coloring,merging, changing font etc. These cosmetic changes should be done only at the last stage that is just before presenting to your boss or users. Otherwise the writing macro becomes little more difficult and complicated. Keep this in mind.
The macro is in the module and is also repeated herer
if you want to retest run undo and then "test"
Sub test() Dim filt As Range, r As Range Worksheets("Jan 12").Activate Set r = Range("A3").CurrentRegion r.AutoFilter field:=Range("M1").Column, Criteria1:="" Set filt = r.Offset(1, 0).Resize(r.Rows.Count - 1).SpecialCells(xlCellTypeVisible) 'MsgBox filt.Address filt.Copy With Worksheets("Feb 12") .Cells(Rows.Count, "A").End(xlUp).Offset(2, 0).PasteSpecial End With ActiveSheet.AutoFilterMode = False Application.CutCopyMode = False End Sub
Sub undo() Dim llastrow As Long Worksheets("Feb 12").Activate llastrow = Cells(Rows.Count, "A").End(xlUp).Row Range(Range("a5"), Cells(llastrow, "A")).EntireRow.Delete End Sub
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Mar 13, 2012 at 05:53 AM
Mar 13, 2012 at 05:53 AM
please post a small extract of one monthly sheet and explain what you want to do with respect to that sheet.
Big.Moe
Posts
32
Registration date
Tuesday March 13, 2012
Status
Member
Last seen
March 19, 2012
Mar 13, 2012 at 03:10 PM
Mar 13, 2012 at 03:10 PM
Thank you so much for your reply.
Could I ask you how I would go about posting part of my worksheet?
Is there a way to attach a file or paste an image into the reply?
When I paste the text from the worksheet it is too wide to fit into the box to properly show the layout.
Thanks.
Could I ask you how I would go about posting part of my worksheet?
Is there a way to attach a file or paste an image into the reply?
When I paste the text from the worksheet it is too wide to fit into the box to properly show the layout.
Thanks.
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Mar 13, 2012 at 10:30 PM
Mar 13, 2012 at 10:30 PM
this newsgroup does not have facility to post a data sheet. but you can upload in some third party like "speedyshare.com" and post the webpage of the upload.
Didn't find the answer you are looking for?
Ask a question
Big.Moe
Posts
32
Registration date
Tuesday March 13, 2012
Status
Member
Last seen
March 19, 2012
Mar 14, 2012 at 06:47 PM
Mar 14, 2012 at 06:47 PM
Thank you so much for that suggestion, I should of thought of that myself.
Here is the link to that file:
http://speedy.sh/rpWPQ/Tracking-List.xlsx
As you will see each patient has it's own row and as they enter each stage (columns C, E, G, I, K, M) someone enters the date, then the Excel sheet generates how many days it took for the patient to that stage for internal efficiency tracking. This keeps going until the patient is finished and out of the system.
However, the issue becomes when patients straddle months and hence straddle multiple worksheets. I would like to see if there is a way to have Excel automatically copy to the next month's sheet the rows of patients that are still in the system (have no date in the final stage column).
Since my original post, I have been learning Advanced Filters and that seemed to almost work, but I ran across a couple snags. One was that when the patients were copied over to the next sheet, the Advanced Filter process overwrote the formulas in columns D, F, H, J, L, & N. So then I tried to not select those columns for the transfer but then got an 'list range' error. Lastly, I was unclear if the Advanced Filter method could be saved and ran automatically at the first of the month. Perhaps there is a different approach to this problem, but my macro skills are very limited.
Again, I apologize for the lengthy post & any help is greatly appreciated.
Here is the link to that file:
http://speedy.sh/rpWPQ/Tracking-List.xlsx
As you will see each patient has it's own row and as they enter each stage (columns C, E, G, I, K, M) someone enters the date, then the Excel sheet generates how many days it took for the patient to that stage for internal efficiency tracking. This keeps going until the patient is finished and out of the system.
However, the issue becomes when patients straddle months and hence straddle multiple worksheets. I would like to see if there is a way to have Excel automatically copy to the next month's sheet the rows of patients that are still in the system (have no date in the final stage column).
Since my original post, I have been learning Advanced Filters and that seemed to almost work, but I ran across a couple snags. One was that when the patients were copied over to the next sheet, the Advanced Filter process overwrote the formulas in columns D, F, H, J, L, & N. So then I tried to not select those columns for the transfer but then got an 'list range' error. Lastly, I was unclear if the Advanced Filter method could be saved and ran automatically at the first of the month. Perhaps there is a different approach to this problem, but my macro skills are very limited.
Again, I apologize for the lengthy post & any help is greatly appreciated.
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Mar 15, 2012 at 01:44 AM
Mar 15, 2012 at 01:44 AM
take two examples one patient who has not straddled and one straddled and explain with reference to the cell addresses.
Big.Moe
Posts
32
Registration date
Tuesday March 13, 2012
Status
Member
Last seen
March 19, 2012
Mar 15, 2012 at 12:17 PM
Mar 15, 2012 at 12:17 PM
Hello again and than you for the continued support,
First let me post a new link to an updated Excel file:
http://speedy.sh/CMQRG/Tracking-List2.xlsx
(I changed the dates to better represent the issue.)
So, let's take the top two patients as an example, which correspond to rows 4 & 5. The row 4 patient has finished all the stages hence having dates entered in all stage cells (C4, E4, G4, I4, K4, M4) with special attention to cell M4 which is the last stage. Cell M4 is the really the cell that determines if the patient gets copied to the next month or not. This patient (row 4) does have a date in M4 so he stays on this sheet and does not get copied to Sheet 'Feb 12'.
The second patient (row 5) has not finished all stages since it only has dates entered in the first two stage cells (C5 & E5). Since M5 is missing the final date, this patient's information (row 5) should be copied to the next month's sheet ('Feb 12').
First let me post a new link to an updated Excel file:
http://speedy.sh/CMQRG/Tracking-List2.xlsx
(I changed the dates to better represent the issue.)
So, let's take the top two patients as an example, which correspond to rows 4 & 5. The row 4 patient has finished all the stages hence having dates entered in all stage cells (C4, E4, G4, I4, K4, M4) with special attention to cell M4 which is the last stage. Cell M4 is the really the cell that determines if the patient gets copied to the next month or not. This patient (row 4) does have a date in M4 so he stays on this sheet and does not get copied to Sheet 'Feb 12'.
The second patient (row 5) has not finished all stages since it only has dates entered in the first two stage cells (C5 & E5). Since M5 is missing the final date, this patient's information (row 5) should be copied to the next month's sheet ('Feb 12').
Big.Moe
Posts
32
Registration date
Tuesday March 13, 2012
Status
Member
Last seen
March 19, 2012
Mar 18, 2012 at 05:31 PM
Mar 18, 2012 at 05:31 PM
Sorry it took me so long to reply. Got busy there for a couple days and had to put this on the back burner.
Thank you so much for the Macro, works like a charm. Nice work!!
Thank you so much for the Macro, works like a charm. Nice work!!