Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
.

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
print button macro & specific tabs to print Chuck[_3_] Excel Worksheet Functions 2 November 22nd 07 01:21 AM
Setting up automated print function in VB Harmon Excel Discussion (Misc queries) 0 March 23rd 07 03:44 PM
Pivot Table macro to set print area and print details of drill down data Steve Haskins Excel Discussion (Misc queries) 2 December 28th 05 05:59 PM
Macro to open print window and set to print entire workbook retseort Excel Discussion (Misc queries) 1 October 27th 05 11:00 PM
Create a print macro that would automatically select print area? wastedwings Excel Worksheet Functions 7 August 22nd 05 10:36 PM


All times are GMT +1. The time now is 02:12 PM.

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"