ich habe da mal ein Frage!
ist es möglich in einer InputBox (Zahl = InputBox) die letzte höchste Zahl aus Spalte B einzulesen.
für eine Hilfe wär ich sehr dankbar.
Grüssle
Uli
Option Explicit
Sub Uli()
Dim VarPrints
'Inputbox mit Type 1 laesst nur Zahlen als Eingabe zu.
VarPrints = Application.InputBox("höchster Wert", "Wert", _
Application.WorksheetFunction.Max(Worksheets("Tabelle2").Range("B:B")), Type:=1)
End Sub
Sub komisch()
Dim dDiesIstDieMaxZahl As Double ' Variable für die grösste Zahl
Dim vInputBox
' Ausgabe in eine Variable
dDiesIstDieMaxZahl = WorksheetFunction.Max(Worksheets("Tabelle2").Range("B:B"))
' Ausgabe in die InputBox
vInputBox = Application.InputBox("Was willst Du damit?", _
"Grösste Zahl + 1", dDiesIstDieMaxZahl + 1, Type:=1)
If vInputBox "" Then
MsgBox "Es wurde eingegeben: " & vbCrLf & vbTab & vInputBox
End If
End Sub
GreetZ Renee
Sub komisch()
Dim dDiesIstDieMaxZahl As Double ' Variable für die grösste Zahl
Dim vInputBox
' Ausgabe in eine Variable
dDiesIstDieMaxZahl = WorksheetFunction.Max(Worksheets("Tabelle2").Range("B:B"))
' Ausgabe in eine Msgbox
MsgBox "Grösste Zahl in Spalte B ist: " & vbCrLf & vbTab & dDiesIstDieMaxZahl
' Ausgabe ? in eine InputBox (komische Anforderung
vInputBox = Application.InputBox("Was willst Du damit?", _
"Grösste Zahl", dDiesIstDieMaxZahl, Type:=1)
If vInputBox "" Then
MsgBox "Es wurde eingegeben: " & vbCrLf & vbTab & vInputBox
End If
End Sub
GreetZ Renee
Die erweiterte Suchfunktion hilft dir, gezielt die besten Antworten zu finden
Suche nach den besten AntwortenEntdecke unsere meistgeklickten Beiträge in der Google Suche
Top 100 Threads jetzt ansehen