Anthony2687
New Member
- Joined
- Jan 5, 2012
- Messages
- 37
I am running into the issue when it has to switch from the GoTo function to Create it causes an error. I can just ignore the error and just continue, but I would like for this to be seemless. Does anyone see my error or have advice? Do</SPAN> |
Sheets("Sheet2").Range("$A$1:$K$299").AutoFilter Field:=4, Criteria1:=Range("A301").Value, Operator:=xlAnd</SPAN> |
Range("A2:K300").Select</SPAN> |
Application.CutCopyMode = False</SPAN> |
Selection.Copy</SPAN> |
SheetExists = False</SPAN> |
On Error GoTo Create</SPAN> |
SheetExists = Sheets(Sheets("Sheet2").Range("A301").Text).Select <> ""</SPAN> |
Cells(Rows.Count, "A").End(xlUp)(2).Select</SPAN> |
ActiveSheet.Paste</SPAN> |
Create:</SPAN> |
If Not SheetExists Then</SPAN> |
Sheets.Add After:=Sheets(Sheets.Count)</SPAN> |
Cells(Rows.Count, "A").End(xlUp)(2).Select</SPAN> |
ActiveSheet.Paste</SPAN> |
ActiveSheet.Name = Range("D2").Value</SPAN> |
End If</SPAN> |
Sheets("Sheet2").Select</SPAN> |
Rows("301:301").Select</SPAN> |
Application.CutCopyMode = False</SPAN> |
Selection.Delete</SPAN> |
Loop Until IsEmpty(ActiveCell) </SPAN> |
<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>