View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy[_3_] Patrick Molloy[_3_] is offline
external usenet poster
 
Posts: 27
Default Automated Print in Macro?

to print the sheet, just add
Activesheet.Print

I don't understand what you mean by "when the macro is
saved"


Patrick Molloy
Microsoft Excel MVP


-----Original Message-----
Below is listed a Macro that I use to run the following
Macro. I would like the worksheet, (TEMPS) to
automatically print when the Macro is saved.

Thanks for looking at my issue...

Krefty

Option Explicit
Sub Macro11()

Dim destCell As Range
Dim weatherWkbk As Workbook

With Workbooks("DegreeDays.XLS").Worksheets

("Weather")
.UsedRange.Clear
Set destCell = .Cells(.Rows.Count, "A").End
(xlUp).Offset(1, 0)
End With

Workbooks.OpenText
Filename:="G:\Gas_Control\EXCEL\DEPT\Month
Reports\weather.xls", _
Origin:=xlWindows, _
StartRow:=1, DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(8, 1), _
Array(30, 1), Array(41, 1), Array(67, 1), Array
(78, 1))

Set weatherWkbk = ActiveWorkbook

ActiveSheet.UsedRange.Copy _
Destination:=destCell

weatherWkbk.Close savechanges:=False

Application.Goto destCell, Scroll:=True

ActiveSheet.UsedRange.Columns.AutoFit

End Sub
.