Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a cell (called Print_Range). I want to call a macro to set the print
range to the contents of Print_Range e.g. $A$1:$E$55 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Macro()
Dim s As String Dim ss As String Dim r As Range ss = "Print_Range" Set r = Range(ss) s = r.Value ActiveSheet.PageSetup.PrintArea = s End Sub This assumes that you have done two things already: 1. created the Name 2. put the range information into it Have a good day -- Gary's Student "Steve" wrote: I have a cell (called Print_Range). I want to call a macro to set the print range to the contents of Print_Range e.g. $A$1:$E$55 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Spot On. Works a treat. Many thanks
"Gary''s Student" wrote: Sub Macro() Dim s As String Dim ss As String Dim r As Range ss = "Print_Range" Set r = Range(ss) s = r.Value ActiveSheet.PageSetup.PrintArea = s End Sub This assumes that you have done two things already: 1. created the Name 2. put the range information into it Have a good day -- Gary's Student "Steve" wrote: I have a cell (called Print_Range). I want to call a macro to set the print range to the contents of Print_Range e.g. $A$1:$E$55 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You are very welcome
-- Gary''s Student "Steve" wrote: Spot On. Works a treat. Many thanks "Gary''s Student" wrote: Sub Macro() Dim s As String Dim ss As String Dim r As Range ss = "Print_Range" Set r = Range(ss) s = r.Value ActiveSheet.PageSetup.PrintArea = s End Sub This assumes that you have done two things already: 1. created the Name 2. put the range information into it Have a good day -- Gary's Student "Steve" wrote: I have a cell (called Print_Range). I want to call a macro to set the print range to the contents of Print_Range e.g. $A$1:$E$55 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to transfer contents of 'Selected' cell to alternate cell. | Excel Worksheet Functions | |||
'IF' Macro to insert cell contents to alternate cell if cell not e | Excel Worksheet Functions | |||
Pass cell contents to external program as commandline option | Excel Discussion (Misc queries) | |||
Macro to remove contents of cell and move all other contents up one row | Excel Discussion (Misc queries) | |||
Please help! Macro to change cell contents based on cell to the left | Excel Programming |