Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i have golf records on sheet 1 in column A i have course name scores, putts,
ect. in the adjacent columns. I need a vba code to cut and paste each course data on a different sheet. For example have all of Course 1 data on sheet 2 all of Course 2 data on sheet 3 ect. Please help Todd |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Ideally your code should do the following! 1. first do an auto filter on the main sheet which contains all th data. This can be done by code similar to Selection.AutoFilter Field:=ColNum, Criteria1:=FiltCriteria 2. copy the filtered data to another sheet. Sub CopyFilter() Dim Rng As Range, FiltRng As Range With ActiveSheet.AutoFilter.Range On Error Resume Next Set FiltRng = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _ .SpecialCells(xlCellTypeVisible) On Error GoTo 0 End With If FiltRng Is Nothing Then MsgBox "No Records Found" Else 'clear report range (modify this suitably) Worksheets("Report").Range("A4:K" & Cells(Rows.Count 2).End(xlUp).Row).Clear 'filter and copy to report sheet Set Rng = ActiveSheet.AutoFilter.Range Rng.Offset(1, 0).Resize(Rng.Rows.Count - 1).Copy _ Destination:=Worksheets("Report").Range("A4") End If 'remove auto filter from main sheet ActiveSheet.ShowAllData End Sub If you are not sure, do a search for Autofilter+help -- lotu ----------------------------------------------------------------------- lotus's Profile: http://www.excelforum.com/member.php...fo&userid=2375 View this thread: http://www.excelforum.com/showthread.php?threadid=49503 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Paste and Paste Special No Longer Working - Excel 2003 | Excel Discussion (Misc queries) | |||
In Excel: add a Paste-Special Option to paste IN REVERSE ORDER. | Excel Worksheet Functions | |||
Excel cut/Paste Problem: Year changes after data is copy and paste | Excel Discussion (Misc queries) | |||
Copy and Paste macro needs to paste to a changing cell reference | Excel Programming | |||
Macro to Paste to specific line, and continue to Paste each time on next row not over | Excel Programming |