ich möchte eine Spalte, die per Makro ausgewählt wird, durchsuchen und alle Zeilen kopieren, die eine Formel beinhalten.
Die Formeln sollen in ein zweite Spalte kopiert werden, die auch durch das Makro ausgewählt wird.
Das auswählen der Spalten funktioniert aber das kopieren nicht, also der Teil:
i = 1
For Each xRgF1 In xRgC1
If Not cell Is Nothing Then
If cell.HasFormula = True Then
cell.EntireRow.Copy Destination:=RgF2
i = i + 1
End If
End If
Next cell
Über eure Hilfe würde ich mich sehr freuen.Danke und Gruß
Dario
Hier noch der gesamte Code:
Sub Formeln()
Dim xRg, xRgC1, xRgC2, xRgF1, xRgF2 As Range
Dim xIntSR, xIntER, xIntSC, xIntEC As Integer
On Error Resume Next
SRg:
Set xRgC1 = Application.InputBox("Select first column formules:", "Kutools for Excel", , , , , , 8)
If xRgC1 Is Nothing Then Exit Sub
If xRgC1.Columns.Count 1 Then
MsgBox "Please select single column"
GoTo SRg
End If
SsRg:
Set xRgC2 = Application.InputBox("Select the column for ouput:", "Kutools for Excel", , , , , , 8)
If xRgC2 Is Nothing Then Exit Sub
If xRgC2.Columns.Count 1 Then
MsgBox "Please select single column"
GoTo SsRg
End If
Set xWs = xRg.Worksheet
i = 1
For Each xRgF1 In xRgC1
If Not cell Is Nothing Then
If cell.HasFormula = True Then
cell.EntireRow.Copy Destination:=RgF2
i = i + 1
End If
End If
Next cell
End Sub