OK, this is untested, but just looking at it (through tired eyes
), I think it ought to work.
Instead of just selecting AE21, it will use the first blank cell below the last data in column AE. (Is that what you wanted, considering your question "What if AE21 has value already ?")
Again, it's untested, so if it gives you an error, post back with which line is highlighted on debug.
<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> MrChongTestSub()
<SPAN style="color:#00007F">Dim</SPAN> Ws <SPAN style="color:#00007F">As</SPAN> Worksheet, ShtCnt <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Integer</SPAN>, NewShtCnt <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Integer</SPAN>
<SPAN style="color:#00007F">Dim</SPAN> x <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Integer</SPAN>, c <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Integer</SPAN>, i <SPAN style="color:#00007F">As</SPAN> Range
ShtCnt = Sheets.Count
NewShtCnt = 0
x = 0
i = Range("AE65536").End(xlUp)(2, 1)
Selection.Offset(-1).Select
c = ActiveCell.Column
ActiveCell.FormulaR1C1 = <SPAN style="color:#00007F">For</SPAN>mat("Output Result", ";;;")
Selection.Resize.CurrentRegion.Select
Selection.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range(i), Unique:=<SPAN style="color:#00007F">True</SPAN>
Range(i).CurrentRegion.Cut
<SPAN style="color:#00007F">For</SPAN> <SPAN style="color:#00007F">Each</SPAN> Ws <SPAN style="color:#00007F">In</SPAN> Worksheets
<SPAN style="color:#00007F">If</SPAN> Ws.Name = "MyNewSheet" <SPAN style="color:#00007F">Then</SPAN>
x = 1
Else: <SPAN style="color:#00007F">If</SPAN> InStr(Ws.Name, "MyNewSheet") <SPAN style="color:#00007F">Then</SPAN> NewShtCnt = NewShtCnt + 1
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN>
<SPAN style="color:#00007F">Next</SPAN>
<SPAN style="color:#00007F">If</SPAN> x = 0 <SPAN style="color:#00007F">Then</SPAN>
Sheets.Add , After:=Sheets(ShtCnt)
ActiveSheet.Name = "MyNewSheet"
ActiveSheet.Paste
Range("D10").Select
MsgBox "Done !!!"
<SPAN style="color:#00007F">Exit</SPAN> <SPAN style="color:#00007F">Sub</SPAN>
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN>
For <SPAN style="color:#00007F">Each</SPAN> Ws <SPAN style="color:#00007F">In</SPAN> Worksheets
<SPAN style="color:#00007F">If</SPAN> InStr(Ws.Name, "MyNewSheet") And Ws.Index = ShtCnt <SPAN style="color:#00007F">Then</SPAN>
Sheets.Add , After:=Sheets(ShtCnt)
ActiveSheet.Name = "MyNewSheet" & NewShtCnt + 1
NewShtCnt = NewShtCnt + 1
ActiveSheet.Paste
Range("D10").Select
MsgBox "Done !!!"
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN>
<SPAN style="color:#00007F">Next</SPAN>
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>
Are we getting any closer to what you want?
Dan