Live-Forum - Die aktuellen Beiträge
Datum
Titel
28.03.2024 21:12:36
28.03.2024 18:31:49
Anzeige
Archiv - Navigation
340to344
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
340to344
340to344
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

Formatierungsfehler im Macro - bei start aus Tabel

Formatierungsfehler im Macro - bei start aus Tabel
20.11.2003 11:11:54
michael
HAllo Forum,

ich habe ein curioses Problem.
wenn ich mein MArco aus der VB umgebung starte läuft es ohne Fehler.
Nun habe ich eine Schaltfläche in meine Tabelle hinzugefügt, von der aus ich das Macro starte, dann kommt ein Fehler dass die Formatierung nicht geht...

aus VB geht:
Cells(1, 3) = "ABRECHNUNG"
With Range("C1").Font
.Size = 10 'Fehlermneldung per SChaltfläche
.Bold = True
End With
Range("C1").HorizontalAlignment = xlCenter 'Fehlermeldg per SChaltfläche


per schaltfläche geht nur:

Cells(1, 3) = "ABRECHNUNG"
Cells(1, 3).Select 'bei Start über Steuerelement in der Tabelle geht es nur über Select!?
With Selection.Font
.Size = 10
.Bold = True
End With

With Selection
.HorizontalAlignment = xlCenter
End With


Was ist falsch??

Im vorraus Danke für eure Hilfe
Michael

6
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
TakeFocusOnClick = False
20.11.2003 11:30:17
ChrisL
Hi Michael

Setz die im Titel erwähnte Eigenschaft des CommondButton auf Falsch.

Gruss
Chris
AW: TakeFocusOnClick = False
20.11.2003 11:43:37
michael
Hallo Chris,

vielen Dank für deine Antwort.

wo muß ich das hinschreiben oder die Eigenschaft ändern??

Danke
Michael
AW: TakeFocusOnClick = False
20.11.2003 11:55:46
ChrisL
Eigenschaft, siehe Antwort von vorher!
AW: TakeFocusOnClick = False
20.11.2003 12:14:02
michael
Danke Chris!!

So geht es!?
Könntest du mir noch kurz erkären was da passiert / was das bedeutet und warum es vorher nicht ging?

Danke
Michael
AW: TakeFocusOnClick = False
20.11.2003 12:25:30
ChrisL
Hi Michael

Ist eine Krankheit von XL97. Es geht der Bezug zum Tabellenblatt verloren, und XL weiss nicht worauf sich dein Code bezieht. TakeFocusOnClick = False lässt den Fokus auf dem Tabellenblatt. Siehe auch XL Hilfe (habe leider nur Englisch)...

The TakeFocusOnClick property defines only what happens when the user clicks a control. If the user tabs to the control, the control takes the focus regardless of the value of TakeFocusOnClick.
Use this property to complete actions that affect a control without requiring that control to give up focus. For example, assume your form includes a TextBox and a CommandButton that checks for correct spelling of text. You would like to be able to select text in the TextBox, then click the CommandButton and run the spelling checker without taking focus away from the TextBox. You can do this by setting the TakeFocusOnClick property of the CommandButton to False.

Gruss
Chris
Anzeige
Super!! VIELEN Dank!!
20.11.2003 12:43:42
michael

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige