Sub Admin_Fee()
Dim fd As Office.FileDialog
Dim lRow As Long
Dim wb1 As Workbook, wb2 As Workbook
Dim sh As Worksheet
Dim lrownew As Long
If AutoFilterMode = True And FilterMode = True Then ActiveSheet.ShowAllData
Set fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
.AllowMultiSelect = False
.Title = "Please select the file."
'
' This stage, all of the questionable contracts should have been sorted out and you should be able to compile a list to charge maxium off of.
'
'
' Clear out the current filters, and add our own.
.Filters.Clear
'.Filters.Add "Excel 2003", "*.xls"
'.Filters.Add "All Files", "*.*"
' Show the dialog box. If the .Show method returns True, the
' user picked at least one file. If the .Show method returns
' False, the user clicked Cancel.
If .Show = True Then
txtfilename = .SelectedItems(1) 'replace txtFileName with your textbox
'MsgBox txtfilename
Workbooks.Open txtfilename
End If
End With
Windows("Finance Extract.xls").Activate
lRow = Cells(Rows.Count, "F").End(xlUp).Row
Range("F9:F" & lRow).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("Admin Fee.xls").Activate
lrownew = Cells(Rows.Count, "C").End(xlUp).Row + 1
Range("E6").PasteSpecial Paste:=xlPasteValues
With fd
.AllowMultiSelect = False
.Title = "Please select the file."
Windows("Admin Fee.xls").Activate
lastrow = Cells(Rows.Count, "E").End(xlUp).Row
Range("K1").Select
Selection.Copy
Range("G6").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.AutoFill Destination:=Range("G6:G" & lastrow)
Range("G6:G" & lastrow).Select
'
' This stage, all of the questionable contracts should have been sorted out and you should be able to compile a list to charge maxium off of.
'
'
' Clear out the current filters, and add our own.
.Filters.Clear
'.Filters.Add "Excel 2003", "*.xls"
'.Filters.Add "All Files", "*.*"
' Show the dialog box. If the .Show method returns True, the
' user picked at least one file. If the .Show method returns
' False, the user clicked Cancel.
If .Show = True Then
txtfilename = .SelectedItems(1) 'replace txtFileName with your textbox
'MsgBox txtfilename
Workbooks.Open txtfilename
End If
End With
Windows("Rental Extract.xls").Activate
lRow = Cells(Rows.Count, "F").End(xlUp).Row
Range("J11:J" & lRow).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("Admin Fee.xls").Activate
lrownew = Cells(Rows.Count, "E").End(xlUp).Row + 1
Range("E" & lrownew).PasteSpecial Paste:=xlPasteValues
[B] Windows("Admin Fee.xls").Activate[/B]
[B] lastrow = Cells(Rows.Count, "G").End(xlUp).Row[/B]
[B] Range("L1").Select[/B]
[B] Selection.Copy[/B]
[B] Range("G" & lRow).Select[/B]
[B] ActiveSheet.Paste[/B]
[B] Application.CutCopyMode = False[/B]
[B] Selection.AutoFill Destination:=Range("G" & lastrow)[/B]
[B] Range("G" & lastrow).Select[/B]