Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Is there any possiblity to get zooming factor page setup if .zoom property set to false/true thanks. HA |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
the following line will return the zoom percentage
MsgBox ActiveSheet.PageSetup.Zoom |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
activewindow.Zoom
-- HTH Bob Phillips (remove xxx from email address if mailing direct) "HA" wrote in message ... Hi, Is there any possiblity to get zooming factor page setup if .zoom property set to false/true thanks. HA |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry for describing the problem on wrong way...
With ActiveSheet.PageSetup .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 End With the problem is when fit to pages wide and tall selected from page setup (as you see in the code), zoom property set to false automatically. if fit to page selected, with vba code ActiveSheet.PageSetup.Zoom returns False. But from page setup dialog box, we can see the zoom factor. I just want to know on that circumstance, is ther any possiblity to get zoom factor. thanks... -- HA "Bob Phillips" , haber iletisinde þunlarý ... activewindow.Zoom -- HTH Bob Phillips (remove xxx from email address if mailing direct) "HA" wrote in message ... Hi, Is there any possiblity to get zooming factor page setup if .zoom property set to false/true thanks. HA |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't think there is a way of getting what you want - zoom is a value
if true, or false if false, if false, then excel calculates on the fly I think. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have never used it, but this was posted in the past:
Here's a post from Jim Rech/Nick Osdale-Popa. Declare Function LockWindowUpdate Lib _ "user32" (ByVal hwndLock As Long) As Long Declare Function FindWindowA Lib _ "user32" (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long Sub SetPageZoom() Dim ZoomFactor As Integer Dim hWnd As Long hWnd = FindWindowA("XLMAIN", Application.Caption) LockWindowUpdate hWnd With ActiveSheet.PageSetup .FitToPagesTall = False .FitToPagesWide = 1 .Zoom = False End With 'in order to calculate the Zoom %, a PrintPreview must initiated. SendKeys "%C" ActiveSheet.PrintPreview 'to get/set the Zoom %, initiate the Page Setup Dialog box. SendKeys "P%A~" Application.Dialogs(xlDialogPageSetup).Show ZoomFactor = ActiveSheet.PageSetup.Zoom ActiveSheet.PageSetup.Zoom = ZoomFactor LockWindowUpdate 0 End Sub -- Regards, Tom Ogilvy "HA" wrote: Sorry for describing the problem on wrong way... With ActiveSheet.PageSetup .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 End With the problem is when fit to pages wide and tall selected from page setup (as you see in the code), zoom property set to false automatically. if fit to page selected, with vba code ActiveSheet.PageSetup.Zoom returns False. But from page setup dialog box, we can see the zoom factor. I just want to know on that circumstance, is ther any possiblity to get zoom factor. thanks... -- HA "Bob Phillips" , haber iletisinde şunları ... activewindow.Zoom -- HTH Bob Phillips (remove xxx from email address if mailing direct) "HA" wrote in message ... Hi, Is there any possiblity to get zooming factor page setup if .zoom property set to false/true thanks. HA |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
try this: Sub Test() Dim vRet As Variant 'FitToPagesWide <-- 1 'FitToPagesTall <-- 1 vRet = ExecuteExcel4Macro("PAGE.SETUP(,,,,,,,,,,,,{1,1})" ) 'Select the Zoom option vRet = ExecuteExcel4Macro("PAGE.SETUP(,,,,,,,,,,,,{#N/A,#N/A})") 'Get the Zoom value MsgBox ActiveSheet.PageSetup.Zoom 'or 'vRet = ExecuteExcel4Macro("GET.DOCUMENT(62)") End Sub -- HTH, okaizawa HA wrote: Sorry for describing the problem on wrong way... With ActiveSheet.PageSetup .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 End With the problem is when fit to pages wide and tall selected from page setup (as you see in the code), zoom property set to false automatically. if fit to page selected, with vba code ActiveSheet.PageSetup.Zoom returns False. But from page setup dialog box, we can see the zoom factor. I just want to know on that circumstance, is ther any possiblity to get zoom factor. thanks... |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Thanks for the code. I have one more question. Is there any way to use that code in a User Defined Function. thanks in advance... -- HA "okaizawa" , haber iletisinde ?unlar? ... Hi, try this: Sub Test() Dim vRet As Variant 'FitToPagesWide <-- 1 'FitToPagesTall <-- 1 vRet = ExecuteExcel4Macro("PAGE.SETUP(,,,,,,,,,,,,{1,1})" ) 'Select the Zoom option vRet = ExecuteExcel4Macro("PAGE.SETUP(,,,,,,,,,,,,{#N/A,#N/A})") 'Get the Zoom value MsgBox ActiveSheet.PageSetup.Zoom 'or 'vRet = ExecuteExcel4Macro("GET.DOCUMENT(62)") End Sub -- HTH, okaizawa HA wrote: Sorry for describing the problem on wrong way... With ActiveSheet.PageSetup .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 End With the problem is when fit to pages wide and tall selected from page setup (as you see in the code), zoom property set to false automatically. if fit to page selected, with vba code ActiveSheet.PageSetup.Zoom returns False. But from page setup dialog box, we can see the zoom factor. I just want to know on that circumstance, is ther any possiblity to get zoom factor. thanks... |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Function ZoomFactor()
ZoomFactor = Windows(Application.Caller.Parent.Parent.Name).Zoo m End Function -- HTH Bob Phillips (remove xxx from email address if mailing direct) "HA" wrote in message ... Hi, Thanks for the code. I have one more question. Is there any way to use that code in a User Defined Function. thanks in advance... -- HA "okaizawa" , haber iletisinde ?unlar? ... Hi, try this: Sub Test() Dim vRet As Variant 'FitToPagesWide <-- 1 'FitToPagesTall <-- 1 vRet = ExecuteExcel4Macro("PAGE.SETUP(,,,,,,,,,,,,{1,1})" ) 'Select the Zoom option vRet = ExecuteExcel4Macro("PAGE.SETUP(,,,,,,,,,,,,{#N/A,#N/A})") 'Get the Zoom value MsgBox ActiveSheet.PageSetup.Zoom 'or 'vRet = ExecuteExcel4Macro("GET.DOCUMENT(62)") End Sub -- HTH, okaizawa HA wrote: Sorry for describing the problem on wrong way... With ActiveSheet.PageSetup .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 End With the problem is when fit to pages wide and tall selected from page setup (as you see in the code), zoom property set to false automatically. if fit to page selected, with vba code ActiveSheet.PageSetup.Zoom returns False. But from page setup dialog box, we can see the zoom factor. I just want to know on that circumstance, is ther any possiblity to get zoom factor. thanks... |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, I meant
Function ZoomFactor() ZoomFactor = Worksheets(Application.Caller.Parent.Name).PageSet up.Zoom End Function -- HTH Bob Phillips (remove xxx from email address if mailing direct) "HA" wrote in message ... Hi, Thanks for the code. I have one more question. Is there any way to use that code in a User Defined Function. thanks in advance... -- HA "okaizawa" , haber iletisinde ?unlar? ... Hi, try this: Sub Test() Dim vRet As Variant 'FitToPagesWide <-- 1 'FitToPagesTall <-- 1 vRet = ExecuteExcel4Macro("PAGE.SETUP(,,,,,,,,,,,,{1,1})" ) 'Select the Zoom option vRet = ExecuteExcel4Macro("PAGE.SETUP(,,,,,,,,,,,,{#N/A,#N/A})") 'Get the Zoom value MsgBox ActiveSheet.PageSetup.Zoom 'or 'vRet = ExecuteExcel4Macro("GET.DOCUMENT(62)") End Sub -- HTH, okaizawa HA wrote: Sorry for describing the problem on wrong way... With ActiveSheet.PageSetup .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 End With the problem is when fit to pages wide and tall selected from page setup (as you see in the code), zoom property set to false automatically. if fit to page selected, with vba code ActiveSheet.PageSetup.Zoom returns False. But from page setup dialog box, we can see the zoom factor. I just want to know on that circumstance, is ther any possiblity to get zoom factor. thanks... |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there any way to use that code in a User Defined Function.
I don't think it is possible in a cell formula. how about Worksheet_Change or Worksheet_Calculate? http://msdn.microsoft.com/library/en...HV05199719.asp http://msdn.microsoft.com/library/en...HV05199619.asp -- HTH, okaizawa HA wrote: Hi, Thanks for the code. I have one more question. Is there any way to use that code in a User Defined Function. thanks in advance... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
X Factor into Percent... | Excel Worksheet Functions | |||
Please help! Print Preview Zoom is Grayed Out...Doesn't zoom. | Excel Discussion (Misc queries) | |||
Time factor | Excel Worksheet Functions | |||
IF FACTOR? | Excel Discussion (Misc queries) | |||
Growth Factor | Excel Discussion (Misc queries) |