#1   Report Post  
Posted to microsoft.public.excel.programming
ed ed is offline
external usenet poster
 
Posts: 59
Default Auton open

I have the following code to format a remittance that i
import from my accounting system.

The problems is everytime i run it it opens up another
sheet in the folder that i save the remittances to. I
cannot work out for the life of me why it is doing it.
Please help. Also listed below this macro is the macro i
use to run all of the other macros from.

Sub Format()
Columns("C:F").Select
Selection.Delete Shift:=xlToLeft
Columns("A:D").Select
Selection.Sort Key1:=Range("D2"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
ActiveWindow.SmallScroll Down:=0
Columns("A:D").EntireColumn.AutoFit
Range("A1:D1").Select
Selection.Font.bold = True

End Sub

Sub bold()
Dim LR As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
Cells(LR, "A").EntireRow.Font.bold = True
End Sub

Sub Multiple()

Dim LR As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
If Cells(LR, "A").Value = Cells(LR - 1, "A").Value Then
Cells(LR, "A").EntireRow.Delete ' Or do you only want to
clear the cell?
End If
End Sub

Sub sum()

Dim Rng As Range
Set Rng = Cells(Rows.Count, "D").End(xlUp)(1, 1)
Rng.Formula = "=-SUM(D1:" & Rng(0, 2).Address(False,
False) & ")"

End Sub

Sub save()
LR = Range("A" & Rows.Count).End(xlUp).Row
ActiveWorkbook.SaveAs "S:\Kingston\FA\Overseas
Payments\Long Haul\2003\Austravel\remittance\" & Cells
(LR, "A").Value & ".xls"
End Sub
__________________________________________________ ________

Sub Remittance()
Application.Run "'S:\Kingston\FA\Overseas Payments\Long
Haul\2003\Austravel\remittance\remittance.xls'!For mat"
Application.Run "'S:\Kingston\FA\Overseas
Payments\Long Haul\2003
\Austravel\remittance\remittance.xls'!Multiple"
Application.Run "'S:\Kingston\FA\Overseas
Payments\Long Haul\2003
\Austravel\remittance\remittance.xls'!Bold"
Application.Run "'S:\Kingston\FA\Overseas
Payments\Long Haul\2003
\Austravel\remittance\remittance.xls'!Save"
Application.Run "'S:\Kingston\FA\Overseas
Payments\Long Haul\2003
\Austravel\remittance\remittance.xls'!sum"

End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ON OPEN VBA Code input incorrectly now excel sheet wont open mmartin New Users to Excel 1 February 16th 11 11:33 PM
Opening Excel, Book1 opens, remains open with other workbook open DanieB Excel Discussion (Misc queries) 0 September 3rd 09 08:23 AM
Auton Populating Dashboard Spreadsheet whatzzup Excel Discussion (Misc queries) 0 October 30th 07 10:36 AM
excel 2003 saved file will not open without a blank workbook open Bob Excel Discussion (Misc queries) 4 November 11th 06 04:24 PM
file open via IE hyperlink causes already open files to shrink and tile Marc Setting up and Configuration of Excel 0 May 4th 05 08:13 PM


All times are GMT +1. The time now is 01:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"