Hallo,
dieses Makro ändert Text im Arbeitsblatt in Großschrift. Kann mir jemand es so umschreiben, das es z.Bsp. nur Blatt 1,Zelle GU45 bearbeitet?
Danke für die Hilfe im Voraus.
Option Explicit
’
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim Zelle As Range
On Error GoTo hell
If Target.Value = „“ Then Exit Sub
If Target.HasFormula Then Exit Sub
Application.EnableEvents = False
For Each Zelle In Target
Zelle.Value = Application.Proper(Zelle.Value)
Next Zelle
hell:
Application.EnableEvents = True
End Sub
dieses Makro ändert Text im Arbeitsblatt in Großschrift. Kann
mir jemand es so umschreiben, das es z.Bsp. nur Blatt 1,Zelle
GU45 bearbeitet?
Hallo Heimat,
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
On Error GoTo hell
If Sh.Name „Tabelle1“ Then Exit Sub
If Target.Value = „“ Or Target.adddress(0, 0) „GU45“ Then Exit Sub
If Target.HasFormula Then Exit Sub
Application.EnableEvents = False
Target.Value = Application.Proper(Target.Value)
hell:
Application.EnableEvents = True
End Sub
Setze mal bei
If Sh.Name „Tabelle1“ Then Exit Sub
einen Haltepunkt.
(in Höhe der zeile auf den Trennbalken davor klicken, oder oben übers Menü Haltepunkt setzen.)
Dann, wenn der Code ausgelöst wwird, gehe ihn mit F8 Step by Step durch und berichte was so geschieht…
Hallo Reinhard,
entschuldige die falsche Anrede vorhin.
Ich hoffe ich habe es richtig durchgeführt:
nach If Sh.Name „Tabelle1“ Then (gelb)wird Exit Sub dunkel eingerahmt,
F8 gedrückt: ganze Zeile dunkel eingerahmt,
If Target.Value = „“ Or Target.adddress(0, 0) „A1“ Then (gelb),
Application.EnableEvents = True (gelb)
End Sub (gelb)
Hallo Reinhard,
ich probiere das in einer neuen Mappe.
Habe nur GU45 in A1 geändert.
Dieser Code von Dir (22.10.) funktioniert perfekt, nur eben das alle Zellen großgeschrieben werden:
Option Explicit
’
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim Zelle As Range
On Error GoTo hell
If Target.Value = „“ Then Exit Sub
If Target.HasFormula Then Exit Sub
Application.EnableEvents = False
For Each Zelle In Target
Zelle.Value = Application.Proper(Zelle.Value)
Next Zelle
hell:
Application.EnableEvents = True
End Sub