Copy data from one worksheet to another worksheet [Closed]

Report
Posts
2
Registration date
Tuesday November 11, 2014
Status
Member
Last seen
November 12, 2014
-
Posts
2
Registration date
Tuesday November 11, 2014
Status
Member
Last seen
November 12, 2014
-
Greetings All,
Let me begin by saying that although I have frequently visited this site and have learned valuable information from the experts, this is the first time I have posted a question. Please let me know if I am breaking any rules. Also I am truly a VBA / Macro Virgin and I really need help. This is my first attempt at writing a macro and after spending over a week searching for solutions and trying various codes - I still cant figure this out. If there is a way to post the workbook, that would be great but I am not sure how to do this.

I need a macro to copy data from WEEK1 worksheet and paste to WEEK2 worksheet.

When the user selects WEEK2 worksheet and presses the "Update Data" button I need the Macro to
1. Go to WEEK1 worksheet
2. Un-filter the data so all data can be copied (and add the filter buttons back)
3. Copy: Starting at Column A Row 7 to Column T
( Don't need to copy title / heading rows) copy down to the last row containing data unless there is a date recorded in column T then don't need to copy this row
4. Go to WEEK2 and paste the data starting at ROW 7
5. Keep all the pasted ROWS at the same height (60.00 or 80 pixels).



Here is the MACRO I have so far. It works well for steps 1 & 2 above. But it continues to copy all the rows in the worksheet even if there is no data in any of the rows. Don't have a clue how to not copy a row based on condition of if there is a date in column T - do not copy and when I paste to worksheet WEEK2 the row height does not remain the same as the copied rows if there were more rows copied then week2 sheet had. Hope this makes sense

Here is Macro
Sub WEEK2UPDATE()
'
' WEEK2UPDATE Macro
' Update by Copying Data from Week 1 and Pasting to Week 2 worksheet
'

'
Sheets("WEEK1").Select
Selection.AutoFilter
ActiveWindow.SmallScroll Down:=0
Selection.AutoFilter
ActiveWindow.SmallScroll Down:=24
Range("A100").Select
Selection.End(xlUp).Select
Range("A7:T100").Select
Range("A7:T100").Activate
Selection.Copy
Sheets("WEEK2").Select
Range("A7:T100").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Sheets("WEEK1").Select
ActiveWindow.SmallScroll Down:=-15
Range("A2:T2").Select
Sheets("WEEK2").Select
Range("A2:N2").Select
End Sub


Thank you for any assistance.

2 replies

Posts
1862
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
July 30, 2015
791
filter week1 for column T not having data and then copy filtered data to week2

try to write a macro for this. you can RECORD macro and then edit the macro.
1
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 2942 users have said thank you to us this month

Posts
2
Registration date
Tuesday November 11, 2014
Status
Member
Last seen
November 12, 2014

Thank you, I don't know why I didn't think of this myself. Such an easy solution now that I see it.

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!