Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

alle Tabellenblätter auf gewisse Größe zoomen

704 views
Skip to first unread message

Christian John

unread,
Sep 10, 2009, 3:41:01 AM9/10/09
to
Hallo Community,

ich möchte ein Makro bauen, das alles Tabellenblättern 65% Zoom zuweist.
Es sind relative viele Tabellenblätter und der Name jedes einzelnen Blattes
soll keine Rolle spielen.
Wie bekomme ich das hin?

Mit active.window kann ich es jaicht machen, und bei Sheets scheint es Zoom
ja nicht zu geben....

??

Danke!

grüße
Christian John

Mike Berger

unread,
Sep 10, 2009, 3:54:57 AM9/10/09
to
Hallo Christian,

ich hatte dies mit folgendem Makro gelöst:

Dim Blatt As Object
Dim intI As Integer
For intI = 1 To ActiveWorkbook.Sheets.Count
Sheets(intI).Activate
ActiveWindow.Zoom = 65
Next intI

Gruß
Mike

Christian John schrieb:

Claus Busch

unread,
Sep 10, 2009, 3:54:38 AM9/10/09
to
Hallo Chritian,

Am Thu, 10 Sep 2009 00:41:01 -0700 schrieb Christian John:

> ich m�chte ein Makro bauen, das alles Tabellenbl�ttern 65% Zoom zuweist.
> Es sind relative viele Tabellenbl�tter und der Name jedes einzelnen Blattes
> soll keine Rolle spielen.

probiers mal so:
Application.ScreenUpdating = False
For i = 1 To Sheets.Count
Sheets(i).Activate
ActiveWindow.Zoom = 65
Next
Application.ScreenUpdating = True


Mit freundlichen Gr�ssen
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

Christian John

unread,
Sep 10, 2009, 5:36:06 AM9/10/09
to
Vielen Dank!
Noch cooler wäre ja wenn man vorher in einem Fenster gefragt würde auf
welchen zoom man es haben will...
Wie würdest Du das machen?

Dass ich eine Variable brauche und eine msgbox, weiß ich...aber dann hört es
auch schon auf... :-(

Danke
Christian John

Noch cool

Claus Busch

unread,
Sep 10, 2009, 5:57:55 AM9/10/09
to
Hallo Christian,

Am Thu, 10 Sep 2009 02:36:06 -0700 schrieb Christian John:

> Noch cooler w�re ja wenn man vorher in einem Fenster gefragt w�rde auf

> welchen zoom man es haben will...

> Wie w�rdest Du das machen?

ins Codemodul "Diese Arbeitsmappe". Beim Aktivieren des Blattes wirst du
gefragt, welche Zoomgr��e eingestellt werden soll. Voreinstellung ist 65%.

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim myZoom As Integer

myZoom = Application.InputBox("Welche Zoomgr��e soll eingestellt werden?",
_
"Zoomgr��e", 65, Type:=1)

If myZoom = 0 Then
Exit Sub
Else
ActiveWindow.Zoom = myZoom
End If

End Sub

Bernhard Sander

unread,
Sep 10, 2009, 6:04:45 AM9/10/09
to
Hallo Christian,

> Noch cooler wäre ja wenn man vorher in einem Fenster gefragt würde auf
> welchen zoom man es haben will...

Warum erst lange die Benutzer nach Zahlen fragen?
Greif den Zoomfaktor des aktiven Blatts ab und setze die anderen Blätter auf
diesen Faktor. Noch eine Ergänzung: aktiviere am Schluss wieder das Ausgangsblatt.

>> Dim intI As Integer
Dim Ausgangsblatt As Sheet
Dim ZoomFaktor As Variant
Set Ausgangsblatt = ActiveSheet
ZoomFaktor = ActiveWindow.Zoom


>> For intI = 1 To ActiveWorkbook.Sheets.Count
>> Sheets(intI).Activate

ActiveWindow.Zoom = ZoomFaktor
>> Next intI
Ausgangsblatt.Activate

Gruß
Bernhard Sander

0 new messages