AW: Private Sub Workbook_Open()MsgBoxFarbige
13.02.2021 17:47:35
werner
wenn ich das wüßte, würde ich nicht fragen...grins, "wie gesagt ich übe und hab keine Ahnung von VB, ich schreib nur ab wie in der Schule, lach..
Vorhanden in der Beispieldatei.
________________-
Diese Arbeitsmappe
FormMsg
Modul
Modu2
Modu3
Modu4
Modu5
Modu6
Tabelle1(Tabelle1)
Tabelle2(Tabelle2)
UserForm1
many MsgHinweise vorhanden
bereists vorhanden
_______________________________________________
Private Sub Workbook_Open()MsgBoxFarbige?
wie kann man Userform um benennen in Uerform2
und verknüpfen odr so? ich hab keine Ahnung.......?
____________________________________________________________________________________________________
'
Private Sub Workbook_Open()?
Sub Modul_3_Neuer_23_TestBox_farbige_Box()
Dim intAntwort As enuButton 'für Rückgabe
Dim strText$
'Columns(1).Clear
Cells(41, 12).Clear
strText = "....Hallo, Text," & vbCr & "Rentenrechner.... !" & vbCr & vbCr
intAntwort = Msg(strText & "Text" & vbCr & "Text ", "Info Rentenrecher", eOk, IDI_INFORMATION, _
RGB(18, 240, 18), , Kursiv, Gross_XL)
Ausgabe_Antwort Cells(41, 12), intAntwort 'Celle(3), Spalte(6)
End Sub
Sub Ausgabe_Antwort(rngRange As Range, intAntwort As enuButton)
Select Case intAntwort
Case eYes: rngRange.Value = "Ja"
Case eNo: rngRange.Value = "Nein"
Case eCancel: rngRange.Value = "Abbruch"
Case eOk: rngRange.Value = "Ok" 'Ok Celle(3, Spalte(6)
End Select
End Sub
'
'Symbole: getauscht IDI_EXCLAMATION,in IDI_CRITICAL,
'IDI_CRITICAL,
'IDI_QUESTION,
'IDI_EXCLAMATION,
'IDI_INFORMATION,
______________________________________________________________________
Sub Neuer_Test_farbige_Box()
Dim intAntwort As enuButton 'für Rückgabe
Dim strText$
'Columns(1).Clear
Cells(3, 6).Clear
strText = "....Hallo, Text," & vbCr & "Rentenrechner.... !" & vbCr & vbCr
intAntwort = Msg(strText & "Text" & vbCr & "Text ", "Info Rentenrecher", eOk, IDI_INFORMATION, RGB(18, 240, 18), , Kursiv, Gross_XL)
Ausgabe_Antwort Cells(3, 6), intAntwort 'Celle(3), Spalte(6)
End Sub
Sub Ausgabe_Antwort(rngRange As Range, intAntwort As enuButton)
Select Case intAntwort
Case eYes: rngRange.Value = "Ja"
Case eNo: rngRange.Value = "Nein"
Case eCancel: rngRange.Value = "Abbruch"
Case eOk: rngRange.Value = "Ok" 'Ok Celle(3, Spalte(6)
End Select
End Sub
'
'Symbole: getauscht IDI_EXCLAMATION,in IDI_CRITICAL,
'IDI_CRITICAL,
'IDI_QUESTION,
'IDI_EXCLAMATION,
'IDI_INFORMATION,
____________________________________________________________________________________________________
Option Explicit
Public Enum enuButton
eYes = 1
eNo = 10
eCancel = 30
eOk = 50
End Enum
Enum enuStyl
IDI_CRITICAL = 32513&
IDI_QUESTION = 32514&
IDI_EXCLAMATION = 32515&
IDI_INFORMATION = 32516&
End Enum
Enum enuFontStyle
Fett = 1
Kursiv = 2
FettKursiv = 3
End Enum
Enum enuFontSize
Gross_X = 10
Gross_XL = 12
Gross_XXL = 14
End Enum
Public msgReturn As enuButton
Function Msg(Prompt$, strTitle$, Optional Buttons As enuButton = eOk, Optional Style As enuStyl = 0, _
Optional RGB_COLOR As Long = 0, Optional RGB_Font_COLOR As Long = 0, Optional Font_Style As enuFontStyle = 0, Optional Font_Size As enuFontSize = 8) As enuButton
Dim oldHeight As Single, oldWidth As Single
With FormMsg 'FormMsg 'Änderung von Userform1 in -> FormMsg '
oldHeight = .Label1.Height
.Caption = strTitle
.Tag = IIf(Style 0, Style, "")
Select Case Buttons
Case eYes, eYes + eNo, eYes + eCancel, eYes + eNo + eCancel
.CommandButton1.Visible = True
Case eOk, eOk + eNo, eOk + eCancel, eOk + eNo + eCancel
.CommandButton1.Caption = "Ok"
.CommandButton1.Visible = True
End Select
Select Case Buttons
Case eNo, eNo + eYes, eCancel + eNo, eNo + eOk, eCancel + eYes + eNo, eCancel + eOk + eNo
.CommandButton2.Visible = True
End Select
Select Case Buttons
Case eCancel, eCancel + eYes, eCancel + eNo, eCancel + eOk, eCancel + eYes + eNo, eCancel + eOk + eNo
.CommandButton3.Visible = True
End Select
.Label1.Font.Bold = (Font_Style = Fett) Or (Font_Style = FettKursiv)
.Label1.Font.Italic = (Font_Style = Kursiv) Or (Font_Style = FettKursiv)
.Label1.Font.Size = Font_Size
.BackColor = IIf(RGB_COLOR = 0, .BackColor, RGB_COLOR)
.Label1.ForeColor = IIf(RGB_Font_COLOR = 0, .Label1.ForeColor, RGB_Font_COLOR)
If Style = 0 Then
.Label1.Left = 5
.Label1.Width = .InsideWidth - 10
End If
.Label1.Caption = Prompt
.Label1.AutoSize = True
oldHeight = .Label1.Height - oldHeight
.Height = IIf(oldHeight > 0, .Height + oldHeight, .Height)
.CommandButton1.Top = IIf(oldHeight > 0, .CommandButton1.Top + oldHeight, .CommandButton1.Top)
.CommandButton2.Top = IIf(oldHeight > 0, .CommandButton2.Top + oldHeight, .CommandButton2.Top)
.CommandButton3.Top = IIf(oldHeight > 0, .CommandButton3.Top + oldHeight, .CommandButton3.Top)
.Show
End With
Msg = msgReturn
msgReturn = 0
End Function
_____________________________________________________________________________________________________