Thema Datum  Von Nutzer Rating
Antwort
15.01.2018 18:44:09 Olli
Solved
16.01.2018 14:19:31 Werner
NotSolved
16.01.2018 15:18:08 Gast22849
NotSolved
16.01.2018 17:29:25 Werner
NotSolved
16.01.2018 20:08:26 Olli
NotSolved
17.01.2018 07:29:39 Gast77180
NotSolved
17.01.2018 11:36:35 Olli
NotSolved
17.01.2018 19:45:47 Gast78391
NotSolved
17.01.2018 20:20:02 Werner
NotSolved
Blau Werte aus einem Dropdownmenü mit Zellen kombinieren
18.01.2018 18:08:16 Olli
NotSolved
18.01.2018 18:52:27 Werner
NotSolved
19.01.2018 18:06:22 Gast3406
NotSolved
19.01.2018 18:40:00 Werner
NotSolved
19.01.2018 18:49:19 Gast42753
NotSolved
19.01.2018 18:57:53 Werner
Solved
20.01.2018 11:50:51 Gast71831
NotSolved

Ansicht des Beitrags:
Von:
Olli
Datum:
18.01.2018 18:08:16
Views:
749
Rating: Antwort:
  Ja
Thema:
Werte aus einem Dropdownmenü mit Zellen kombinieren

Hallo Werner,

 

habe deinen Code wie folgt an meine Benennungen angepasst. Musste noch eine Spalten des Ausgangsmaterials ändern bzw hinzufügen:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
Private Sub optbottom_Click()
 
'Textbox1 = txtcleaningtime
'TExtbox2 = txthireloss
'textbox3 = txtcleaningcosts
'TExtbox4 = txttotalcosts
 
'Checkbox1 = optbottom
'Checkbox2 = optsides
'ComboBox1 = cboVslName
  
With Worksheets("Vsl details") 'Blattname anpassen
    Me.txttotalcosts = ""
        'Daten aus Spalte L (cleaning flat bottom) in Textbox
        If Me.optbottom And Not Me.optsides And Me.cboVslName.ListIndex > -1 Then
            Me.txtcleaningtime = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:L"), 12, False), "0.00")
            'Daten aus Spalte O (hire loss for cleaning flat bottom) in Textbox 2
            Me.txthireloss = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:O"), 15, False), "0.00")
            Me.txtcleaningcosts = ""
         
        ElseIf Me.optsides And Not Me.optbottom And Me.cboVslName.ListIndex > -1 Then
            'Daten aus Spalte M in txtcleaningtime
            Me.txtcleaningtime = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:M"), 13, False), "0.00")
            'Daten aus Spalte P in txthireloss
            Me.txthireloss = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:P"), 16, False), "0.00")
            'Daten aus Spalte R in txtcleaningcosts
            Me.txtcleaningcosts = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:R"), 18, False), "0.00")
         
        ElseIf Me.optbottom And Me.optsides And Me.cboVslName.ListIndex > -1 Then
            'Daten aus Spalte N in txtcleaningtime
            Me.txtcleaningtime = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:N"), 14, False), "0.00")
            'Daten aus Spalte Q in txthireloss
            Me.txthireloss = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:Q"), 17, False), "0.00")
            'Daten aus Spalte T in txtcleaningcosts
            Me.txtcleaningcosts = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:S"), 19, False), "0.00")
         
        Else
            Me.txtcleaningtime = ""
            Me.txthireloss = ""
            Me.txtcleaningcosts = ""
            Me.txttotalcosts = ""
        End If
End With
      
End Sub
  
Private Sub optsides_Click()
'Textbox1 = txtcleaningtime
'TExtbox2 = txthireloss
'textbox3 = txtcleaningcosts
'TExtbox4 = txttotalcosts
 
'Checkbox1 = optbottom
'Checkbox2 = optsides
'ComboBox1 = cboVslName
  
With Worksheets("Vsl details") 'Blattname anpassen
    Me.txttotalcosts = ""
    If Me.optsides And Not Me.optbottom And Me.cboVslName.ListIndex > -1 Then
        'Daten aus Spalte M in Textbox1
        Me.txtcleaningtime = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:M"), 13, False), "0.00")
        'Daten aus Spalte P in Textbox2
        Me.txthireloss = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:P"), 16, False), "0.00")
        'Daten aus Spalte R in Textbox3
        Me.txtcleaningcosts = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:R"), 18, False), "0.00")
     
    ElseIf Me.optbottom And Not Me.optsides And Me.cboVslName.ListIndex > -1 Then
        Me.txtcleaningtime = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:L"), 12, False), "0.00")
        'Daten aus Spalte O in Textbox
        Me.txthireloss = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:O"), 15, False), "0.00")
        Me.txtcleaningcosts = ""
     
    ElseIf Me.optsides And Me.optbottom And Me.cboVslName.ListIndex > -1 Then
        'Daten aus Spalte N in Textbox1
        Me.txtcleaningtime = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:N"), 14, False), "0.00")
        'Daten aus Spalte Q in Textbox2
        Me.txthireloss = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:Q"), 17, False), "0.00")
        'Daten aus Spalte T in Textbox3
        Me.txtcleaningcosts = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:T"), 20, False), "0.00")
     
    Else
        Me.txtcleaningtime = ""
        Me.txthireloss = ""
        Me.txtcleaningcosts = ""
        Me.txttotalcosts = ""
    End If
End With
  
End Sub
  
Private Sub cboVslName_Change()
'Textbox1 = txtcleaningtime
'TExtbox2 = txthireloss
'textbox3 = txtcleaningcosts
'TExtbox4 = txttotalcosts
 
 
'Checkbox1 = optbottom
'Checkbox2 = optsides
'ComboBox1 = cboVslName
  
With Worksheets("Vsl details") 'Blattname anpassen
    If Me.cboVslName = "" Then
        Me.txtcleaningtime = ""
        Me.txthireloss = ""
        Me.txtcleaningcosts = ""
        Me.txttotalcosts = ""
        Exit Sub
    End If
    Me.txttotalcosts = ""
    If Me.optbottom And Not Me.optsides Then
        'Daten aus Spalte L in Textbox1
        Me.txtcleaningtime = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:L"), 12, False), "0.00")
        'Daten aus Spalte O in Textbox2
        Me.txthireloss = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:O"), 15, False), "0.00")
        Me.txtcleaningcosts = ""
    ElseIf Me.optsides And Not Me.optbottom Then
        'Daten aus Spalte M in Textbox1
        Me.txtcleaningtime = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:M"), 13, False), "0.00")
        'Daten aus Spalte P in Textbox2
        Me.txthireloss = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:P"), 16, False), "0.00")
        'Daten aus Spalte R in Textbox3
        Me.txtcleaningcosts = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:R"), 18, False), "0.00")
    ElseIf Me.optbottom And Me.optsides Then
        'Daten aus Spalte N in Textbox1
        Me.txtcleaningtime = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:N"), 14, False), "0.00")
        'Daten aus Spalte Q in Textbox2
        Me.txthireloss = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:Q"), 17, False), "0.00")
        'Daten aus Spalte T in Textbox3
        Me.txtcleaningcosts = Format(WorksheetFunction.VLookup(Me.cboVslName, .Range("A:T"), 20, False), "0.00")
     
    End If
End With
  
End Sub
  
Private Sub cmdCalculate_Click()
'Textbox1 = txtcleaningtime
'TExtbox2 = txthireloss
'textbox3 = txtcleaningcosts
'TExtbox4 = txttotalcosts
 
'Checkbox1 = optbottom
'Checkbox2 = optsides
'ComboBox1 = cboVslName
  
If Not Me.optbottom And Not Me.optsides Then
    MsgBox "Es wurde keine Auswahl getroffen."
    Exit Sub
End If
If Me.optbottom And Not Me.optsides And Me.cboVslName.ListIndex > -1 Then
    Me.txttotalcosts = Format(CDbl(Me.txthireloss), "0.00")
'End If
ElseIf Me.optbottom And Me.optsides And Me.cboVslName.ListIndex > -1 Then
    Me.txttotalcosts = Format(CDbl(Me.txthireloss) + CDbl(Me.txtcleaningcosts), "0.00")
'End If
ElseIf Me.optsides And Not optbottom And Me.cboVslName.ListIndex > -1 Then
    Me.txttotalcosts = Format(CDbl(Me.txthireloss) + CDbl(Me.txtcleaningcosts), "0.00")
Else
    MsgBox "Bitte ein Schiff auswählen."
End If
  
End Sub

 

 

Gruß Olli


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
15.01.2018 18:44:09 Olli
Solved
16.01.2018 14:19:31 Werner
NotSolved
16.01.2018 15:18:08 Gast22849
NotSolved
16.01.2018 17:29:25 Werner
NotSolved
16.01.2018 20:08:26 Olli
NotSolved
17.01.2018 07:29:39 Gast77180
NotSolved
17.01.2018 11:36:35 Olli
NotSolved
17.01.2018 19:45:47 Gast78391
NotSolved
17.01.2018 20:20:02 Werner
NotSolved
Blau Werte aus einem Dropdownmenü mit Zellen kombinieren
18.01.2018 18:08:16 Olli
NotSolved
18.01.2018 18:52:27 Werner
NotSolved
19.01.2018 18:06:22 Gast3406
NotSolved
19.01.2018 18:40:00 Werner
NotSolved
19.01.2018 18:49:19 Gast42753
NotSolved
19.01.2018 18:57:53 Werner
Solved
20.01.2018 11:50:51 Gast71831
NotSolved