Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi;
Is it possible to make Excel take the TopMargin value from a variable or a cell. I tried a number of variations and VBA keeps sending message: 'object does not support this property or method' e.g. .... upmargin = Range("l2") prtsheet.TopMargin = Application.InchesToPoints(upmargin) .... Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
John,
Try this: With ActiveSheet.PageSetup .TopMargin = Application.InchesToPoints(Range("A1")) End With or x = 0.5 With ActiveSheet.PageSetup .TopMargin = Application.InchesToPoints(x) End With -- sb "John S." wrote in message ... Hi; Is it possible to make Excel take the TopMargin value from a variable or a cell. I tried a number of variations and VBA keeps sending message: 'object does not support this property or method' e.g. ... upmargin = Range("l2") prtsheet.TopMargin = Application.InchesToPoints(upmargin) ... Thanks. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
John,
TopMargin is a property of the PageSetup object, so try something like prtsheet.PageSetup.TopMargin = Application.InchesToPoints(Range("A1").Value) -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "John S." wrote in message ... Hi; Is it possible to make Excel take the TopMargin value from a variable or a cell. I tried a number of variations and VBA keeps sending message: 'object does not support this property or method' e.g. ... upmargin = Range("l2") prtsheet.TopMargin = Application.InchesToPoints(upmargin) ... Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
setting default filter setting | Charts and Charting in Excel | |||
setting XValues property when charting using macros | Charts and Charting in Excel | |||
Error setting shape text property | Charts and Charting in Excel | |||
Setting default pivot table field setting to "sum" | Excel Discussion (Misc queries) | |||
setting formula property | Excel Programming |