• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA code that opens a file called “HCA Accounts m-d-YYYY” performs some formatting and saves it in a

Joe Anderson

New Member
Code:
Sub Actdir2()
'
' Actdir2 Macro
'
' Keyboard Shortcut: Ctrl+Shift+N
'
    Application.WindowState = xlMaximized
    ChDir "\\hke.local\hisna\Public\HISNA_InfraEngineering\HMFC Users"
    Workbooks.Open Filename:= _
        "\\hke.local\hisna\Public\HISNA_InfraEngineering\HMFC Users\HCA Accounts 8-9-2017.xlsx"
    ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range( _
        "B2:B16240"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
        xlSortTextAsNumbers


Application.CutCopyMode = False
    ChDir "G:\CF Operations\Access\User AD\HMFC ID numbers"
    ActiveWorkbook.SaveAs Filename:= _
        "G:\CF Operations\Access\User AD\HMFC ID numbers\HCA Accounts 8-9-2017.xlsx", _
        FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
End Sub
 
Last edited by a moderator:
Joe

Firstly, Welcome to the Chandoo.org Forums

Is there a question here Joe?
 
Hello joe.
Am trying to understand from your above code though there is no question as HUI said.

You are trying to search and open file called HCA Accounts 8-9-2017.xlsx" from the folder..

Let us know...
 
Back
Top