Removing the selecting will help.
I'm not sure what the "Anon" part is because there doesn't appear to be any such entries. If you can explain what you are attempting then it would help
Edited so far:
Option Explicit
Dim vmgfilename As String
Dim WshShell As Object
Dim SpecialPath As String
'
Sub VirginMoney()
Dim rg As Range
Set WshShell = CreateObject("WScript.Shell") ' Activate shell & get Desktop Path
SpecialPath = WshShell.SpecialFolders("Desktop")
'Call donationref ' Add text to ID
Columns("H").Delete
' ask for the filename
vmgfilename = InputBox("Please enter file name:" & vbCrLf & vbCrLf & vbCrLf & vbCrLf _
& "Format Date-Amount eg. 01092009-6798 ", "Enter File Name")
' ChDir "Y:\Letters\Donorflex Imports\Virgin Money"
' ActiveWorkbook.SaveAs Filename:= _
' "Y:\Letters\Donorflex Imports\Virgin Money\VMG-" & vmgfilename & "-Queries", _
' FileFormat:=xlNormal, CreateBackup:=False
'#### Demo purpose only #####
ChDir SpecialPath
ActiveWorkbook.SaveAs Filename:= _
SpecialPath & "\VMG-" & vmgfilename & "-Queries", _
FileFormat:=xlNormal, CreateBackup:=False
'############################
' Add Worksheets
ActiveSheet.Name = "Donors"
Sheets.Add
ActiveSheet.Name = "Anonymous"
With Sheets("Donors")
.Columns("A").Insert ' add new column
.Range("A1").Value = "Type" ' Name Column Header
' Insert Calculation on each row
.Range("A2").FormulaR1C1 = "=IF(ISBLANK(RC[12]),""Anon"",""Donor"")"
Set rg = .Range("A2") 'Starting point of rows to autofill
Set rg = .Range(rg, Cells(Cells(Rows.Count, 2).End(xlUp).Row, rg.Column))
rg.Cells(1, 1).AutoFill Destination:=rg, Type:=xlFillDefault
.Columns("A").Value = .Columns("A").Value
' SortBy
rg.Sort Key1:=.Range("A2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal
Bookmarks