AW: noch zwei offene Punkte?
21.11.2016 17:42:52
Bastian
Uf ja =D
Hier
Option Explicit
Private Sub Button_Speichen_Click()
Dim WsDeingabe As Worksheet
Dim WsDaten As Worksheet
Dim WsPnamen As Worksheet
Dim Strarray(14) As Variant
Dim DatenArray() As Variant
Dim zell As Range
Dim LastCellWsDeingabe As Long
Dim LastCellWsWsDaten As Long
Dim LastcolumnWsDeingabe As Long
Dim LastCellWsPnamen As Long
Dim x As Long, r As Long, c As Long, cc As Long, rr As Long
With ThisWorkbook
Set WsDeingabe = .Worksheets("Dateneingabe")
Set WsDaten = .Worksheets("Daten")
Set WsPnamen = .Worksheets("Projektnamen")
End With
With WsDeingabe
For Each zell In .Range("B2:B9") 'B4:B7 zuvor
Strarray(x) = zell
x = x + 1
Next
With WsPnamen
LastCellWsPnamen = .Columns(1).Find("*", .Cells(1, 1), xlValues, xlWhole, , xlPrevious).Row + 1 _
'Cells(Zeile,Spalte).
On Error Resume Next
If Not Application.WorksheetFunction.Match(Strarray(0), .Columns(2), 0) Then
.Cells(LastCellWsPnamen, 2) = Strarray(0)
End If
End With
LastCellWsDeingabe = .Cells(.Rows.Count, 1).End(xlUp).Row
LastcolumnWsDeingabe = .Rows(10).Find("*", .Cells(10, 1), xlValues, xlWhole, , xlPrevious). _
Column
For r = 11 To LastCellWsDeingabe
For c = 1 To 3
Strarray(x) = .Cells(r, c)
x = x + 1
Next
For cc = 4 To LastcolumnWsDeingabe
Strarray(x) = .Cells(10, cc)
x = x + 1
If .Cells(r, cc) = "" Then GoTo Überspringen
Strarray(x) = .Cells(r, cc)
DatenArray = WsDaten.Range("A1").CurrentRegion
For rr = LBound(DatenArray, 1) To UBound(DatenArray, 1)
If DatenArray(rr, 1) & "_" & DatenArray(rr, 9) & "_" & DatenArray(rr, 12) = Strarray(0) & "_" & _
Strarray(8) & "_" & Strarray(11) Then
If MsgBox("Soll der Datensatz >>" & DatenArray(rr, 1) & "_" & DatenArray(rr, 9) & "_" & Format( _
DatenArray(rr, 12), "MMM YY") & "
Gruß Basti