PS..I have tried the advanced filter, won't copy to a secondary sheet
Jeanne
Try the following macro. Its a quick fix there is probably a more efficient way of doing it and its not very sophisticated (e.g. an input box could be used instead of a cell on the DailyLog sheet, there is no error handling code, etc.). It can always be polished up later if it does what you are looking for.
It has been assumed that the customer names on the DailyLog start at cell A3.
Before running the macro, you do not have to do any filtering or sorting but you must type into cell A1 the customer name for whom you want the data pasted.
(You can use another cell if you wish and change the code accordingly.)
Please also note that the spelling, spacing, etc. of a customer name must be exactly the same in every place it appears i.e. in cell A1, in the customer list on the DailyLog, AND the name of the customer sheet.
Sub PasteToCustSheet()
Dim C As Range
Sheets("DailyLog").Activate
For Each C In Range(Range("A3"), Range("A65536").End(xlUp))
If C.Value = Range("A1").Value Then
C.EntireRow.Copy
ActiveSheet.Paste ThisWorkbook.Sheets(C.Value).Range("a65536").End(xlUp).Offset(1, 0)
End If
Next
Application.CutCopyMode = False
End Sub
Celia
Celia,
Thank you for your response but this line of code is giving me trouble...
ActiveSheet.Paste ThisWorkbook.Sheets(C.Value).Range("a65536").End(xlUp).Offset(1, 0)
Is there any clarification that I need to make to this line in order for this macro to work?
Thanks for all your help!!
Jeanne
Jeanne
I think the line should read;
ActiveSheet.Paste ThisWorkbook.Sheets("DailyLog").Range("a65536").End(xlUp).Offset(1, 0)
Ivan ,
Jeanne
I've tested the code and it works.
The problem must be that you are entering a customer name in cell A1 on the DailyLog but you do not have a customer sheet with exactly the same name.
You first need to create a sheet for each customer and the name of each sheet must be exactly the same as the name entered in cell A1 of the DailyLog.
Celia ,