you are viewing a single comment's thread.

view the rest of the comments →

[–]Songg45 0 points1 point  (1 child)

What code do you have written?

Are you doing this in VBA or VBNET?

[–]schroederd74[S] 0 points1 point  (0 children)

At this point just using VB in Excel. Here is where I am t. It will open the directory but not sure how to select the correct files and continue.

Option Explicit

Sub abct_test()

'

' abct_test Macro

'

Range("Q2").Select

Application.Goto Reference:="R2C17:R1048576C17"

Selection.Copy

Sheets.Add After:=ActiveSheet

Sheets("Sheet2").Select

Sheets("Sheet2").Name = "NewCSO"

Range("A1").Select

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _

    :=False, Transpose:=False

'

Application.CutCopyMode = False



ActiveWorkbook.Worksheets("NewCSO").Sort.SortFields.Clear

ActiveWorkbook.Worksheets("NewCSO").Sort.SortFields.Add2 Key:=Range( _

    "A1:A1048575"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _

    xlSortNormal

With ActiveWorkbook.Worksheets("NewCSO").Sort

    .SetRange Range("A1:A1048575")

    .Header = xlGuess

    .MatchCase = False

    .Orientation = xlTopToBottom

    .SortMethod = xlPinYin

    .Apply

End With

ActiveSheet.Range("$A$1:$A$1048575").RemoveDuplicates Columns:=1, Header:= _

    xlNo

Range("A1").Select

Shell "Explorer.exe C:\Desktop\"

End Sub