Makro läuft nicht unter Excel 2007 (VISTA)
04.04.2008 11:31:00
P.Ro
ich habe folgendes Makro in Verwendung (nicht selbst erstellt).
Bei mir unter XP (Excel 2002) läuft alles prima. Unter VSTA mit Excel 2007 kommt beim Start des Makros eine Fehlermeldung.
Habe schon mal gefragt aber keine Lösung gefunden.
Kann mir jemand sagen woran das liegt?
Danke
Paul
----------------------
'Zeigt Spaltenbreite und Zeilehhöhe in cm an
'Die gewünschte Spaltenbreite und Zeilenhöhe kann über
'Inputbox eingegeben werden. Alle markierten Spalten werden geändert.
'L. Meister 6.1.02
Sub Format_Spalten_ZeilenCM()
Dim sBreite As Single
Dim sAktuell As Single
Dim strText As String
Dim strAntwort As String
Dim ZHöhe As Single
Dim ZAktuell As Single
On Error GoTo Fehler
Spalte = Selection.ColumnWidth
sAktuell = (Selection.ColumnWidth + 0.71) / 5.1425 * 10
'strText = "Faktor Modulbreite: " & _
'Format(sAktuell, "###0.00") & Chr(13) _
'& "Gib den Wert aus der Zelle BREITE ein" & _
'strAntwort = ActiveSheet.Range("b5").Value
'strAntwort = InputBox(strText, "Neue Spaltenbreite festlegen", _
Format(sAktuell, "###0.00"))
'If strAntwort "" Then
'sBreite = Val(strAntwort)
'sBreite = CSng(strAntwort)
sBreite = [b5]
Selection.ColumnWidth = -0.71 + 5.1425 * sBreite / 10
'End If
ZAktuell = Selection.RowHeight
Faktor = 2.99999
ZAktuell = ZAktuell / Faktor '(Selection.RowHeight)
'strText = "Faktor Modulhöhe: " & _
Format(ZAktuell, "###0.00") & Chr(13) _
'& "Gib den Wert aus der Zelle HÖHE ein" & _
'strAntwort = ActiveSheet.Range("b7).Value
'strAntwort = InputBox(strText, "Neue Zeilenhöhe festlegen", _
Format(ZAktuell, "###0.00"))
'If strAntwort "" Then
'ZHöhe = CSng(strAntwort)
ZHöhe = [b7]
Selection.RowHeight = Faktor * ZHöhe
'End If
Range("A1").Select
Exit Sub
Fehler:
Range("i8").Select
End Sub