Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Will a macro close print preview. I had a macro perform other tasks, and then
open in print preview, however it will not close the preview. I really need to. What am I doing wrong. I am pasting the macro below. -- Cheryl/ Sub ConvertData() ' ' ConvertData Macro ' Converts date, time, temperature to Celcius, bolds, averages celcius temp, print preview ' ' Keyboard Shortcut: Ctrl+d ' Columns("A:A").Select Selection.NumberFormat = "m/d/yyyy" Columns("B:B").Select Selection.NumberFormat = "h:mm;@" Columns("C:C").EntireColumn.AutoFit Range("D1").Select ActiveCell.FormulaR1C1 = "Celcius" With ActiveCell.Characters(Start:=1, Length:=7).Font .Name = "Arial" .FontStyle = "Regular" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic .TintAndShade = 0 .ThemeFont = xlThemeFontNone End With Range("D2").Select ActiveCell.FormulaR1C1 = "=5/9*(RC[-1]-32)" Range("D2").Select Selection.AutoFill Destination:=Range("D2:D26"), Type:=xlFillDefault Range("D2:D26").Select Columns("D:D").Select Selection.NumberFormat = "0.0" Range("A1:D1").Select Selection.Font.Bold = True Columns("C:C").ColumnWidth = 11 Range("A27").Select ActiveCell.FormulaR1C1 = "Average" With ActiveCell.Characters(Start:=1, Length:=7).Font .Name = "Arial" .FontStyle = "Regular" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic .TintAndShade = 0 .ThemeFont = xlThemeFontNone End With Range("A27").Select Selection.Font.Bold = True Range("D27").Select ActiveCell.FormulaR1C1 = "=AVERAGE(R[-25]C:R[-1]C)" Range("D27").Select Selection.Font.Bold = True Range("F1").Select With ActiveSheet.PageSetup .PrintTitleRows = "" .PrintTitleColumns = "" End With ActiveSheet.PageSetup.PrintArea = "" With ActiveSheet.PageSetup .LeftHeader = "" .CenterHeader = "MediTrax Controls" .RightHeader = "" .LeftFooter = "" .CenterFooter = "" .RightFooter = "Cheryl Sarver" .LeftMargin = Application.InchesToPoints(0.75) .RightMargin = Application.InchesToPoints(0.75) .TopMargin = Application.InchesToPoints(1) .BottomMargin = Application.InchesToPoints(1) .HeaderMargin = Application.InchesToPoints(0.5) .FooterMargin = Application.InchesToPoints(0.5) .PrintHeadings = False .PrintGridlines = False .PrintComments = xlPrintNoComments .PrintQuality = 600 .CenterHorizontally = True .CenterVertically = False .Orientation = xlPortrait .Draft = False .PaperSize = xlPaperLetter .FirstPageNumber = xlAutomatic .Order = xlDownThenOver .BlackAndWhite = False .Zoom = 100 .PrintErrors = xlPrintErrorsDisplayed .OddAndEvenPagesHeaderFooter = False .DifferentFirstPageHeaderFooter = False .ScaleWithDocHeaderFooter = True .AlignMarginsHeaderFooter = False .EvenPage.LeftHeader.Text = "" .EvenPage.CenterHeader.Text = "" .EvenPage.RightHeader.Text = "" .EvenPage.LeftFooter.Text = "" .EvenPage.CenterFooter.Text = "" .EvenPage.RightFooter.Text = "" .FirstPage.LeftHeader.Text = "" .FirstPage.CenterHeader.Text = "" .FirstPage.RightHeader.Text = "" .FirstPage.LeftFooter.Text = "" .FirstPage.CenterFooter.Text = "" .FirstPage.RightFooter.Text = "" End With ActiveWindow.SelectedSheets.PrintPreview End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel 2007 macros - how to merge 5 macros together into one | Excel Discussion (Misc queries) | |||
Macros within Excel | New Users to Excel | |||
Macros warning always shows up, even if all macros removed | Excel Discussion (Misc queries) | |||
Macros - copying macros from one computer to another | Excel Discussion (Misc queries) | |||
Training: More on how to use macros in Excel: Recording Macros | Excel Worksheet Functions |