AW: Array-Formel in VBA-Code umwandeln?
26.10.2008 12:32:00
Daniel
Hi
eine Möglichkeit wäre, in der Tabelle "1" spaltenweise den Autofilter auf "NichtLeere" zu setzen und die sichtbaren Mitarbeiter aus Spalte 1 in die Planungstabelle zu kopieren:
Sub Übertragen()
Dim rngMA As Range, rngAbw As Range
Dim shP As Worksheet, sh1 As Worksheet
Dim sp As Long
Set sh1 = Sheets("1")
Set shP = Sheets("Plantafel")
Set rngMA = Range(sh1.Cells(5, 1), sh1.Cells(Rows.Count, 1).End(xlUp))
Set rngAbw = Range(sh1.Cells(4, 1), sh1.Cells(sh1.Cells(Rows.Count, 1).End(xlUp).Row, _
Cells(2, Columns.Count).End(xlToLeft).Column))
For sp = 2 To rngAbw.Columns.Count
rngAbw.AutoFilter Field:=sp, Criteria1:=""
On Error Resume Next
rngMA.SpecialCells(xlCellTypeVisible).Copy Destination:=shP.Cells(108, sp)
On Error GoTo 0
sh1.ShowAllData
Next
End Sub
Gruß, Daniel
Gruß, Daniel