ich möchte eine bestimmte Formel in den Zellen einer bestimmen Range einfügen. Die Formel soll dabei abhängig von der Spalte der jeweiligen Zelle sein.
Das habe ich mit folgender Formel/Code (Bereich der fett markiert ist) probiert und erhalte in den jeweiligen Zellen leider nur "FALSE". Hat jemand eine Ahnung was ich falsch gemacht habe, bzw. wie ich dieses Problem lösen kann?
Public Sub fuellen()
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("DB Backlog")
Debug.Print (semana)
Dim rlast As Integer
Dim rlast2 As Integer
Dim iRunner As Integer
Dim sSpalte As String
Dim jRunner As Integer
Dim jSpalte As String
Dim copy_area As Range
Dim Formula As Variant
Dim FormulaV As Variant
Dim k_range As Range
Dim Bereich As Range
Dim copyn As Range
Dim cell As Range
rlast2 = ws.UsedRange.SpecialCells(xlCellTypeLastCell).Row
For iRunner = 1 To 26
sSpalte = ws.Cells(3, iRunner).Value
If sSpalte = "Description" Then
For Each cell In ws.Range(ws.Cells(rlast2, iRunner).End(xlUp).Offset(1, 0), ws.Cells(rlast2, iRunner))
cell.Value = FormulaLocal = "=VLOOKUP(B & cell.row,'DB Items'!$A$1:$B$2824,2,0)"
'
' Set k_range = ws.Range(ws.Cells(rlast2, iRunner).End(xlUp).Offset(1, 0), ws.Cells(rlast2, iRunner))
' Debug.Print (k_range.Address)
'' k_range = ws.Cells(rlast2, iRunner).End(xlUp).Offset(-1, 0).Formula
' Set copyn = ws.Cells(rlast2, iRunner).End(xlUp).Offset(-1, 0)
' With k_range
' .FormulaLocal = "=VLOOKUP(B4,'DB Items'!$A$1:$B$2824,2,0)"
' Set Bereich = Sheet9.UsedRange
' Bereich.AutoFilter Field:=iRunner, Criteria1:="#N/A"
' Debug.Print (iRunner)
' End With
Next
End If
Next