O
Oldjay
After I filter list I want to copy only the visible rows but with the below
code it copies the hidden rows.
also
Private Sub CommandButton1_Click() ' Analyze records
Dim c As Range
Dim ws As Worksheet
Dim iEnd As Long
Dim ws1 As Worksheet
UndoMyFilter
Set ws = Sheets("Summary")
iEnd = ws.Range("B7").End(xlDown).Row
For Each c In ws.Range("B7:B" & iEnd)
If c < ws.Range("G1") Then c.EntireRow.Hidden = True
Next c
For Each c In ws.Range("B26:B" & iEnd)
If c > ws.Range("G2") Then c.EntireRow.Hidden = True
Next c
For Each c In ws.Range("B7:B" & iEnd)
If c.Offset(0, 2) <> ws.Range("G3") Then c.EntireRow.Hidden = True
Next c
Application.CutCopyMode = False
Range("B6:F6").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Analyze").Select
Range("E36").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub
code it copies the hidden rows.
also
Private Sub CommandButton1_Click() ' Analyze records
Dim c As Range
Dim ws As Worksheet
Dim iEnd As Long
Dim ws1 As Worksheet
UndoMyFilter
Set ws = Sheets("Summary")
iEnd = ws.Range("B7").End(xlDown).Row
For Each c In ws.Range("B7:B" & iEnd)
If c < ws.Range("G1") Then c.EntireRow.Hidden = True
Next c
For Each c In ws.Range("B26:B" & iEnd)
If c > ws.Range("G2") Then c.EntireRow.Hidden = True
Next c
For Each c In ws.Range("B7:B" & iEnd)
If c.Offset(0, 2) <> ws.Range("G3") Then c.EntireRow.Hidden = True
Next c
Application.CutCopyMode = False
Range("B6:F6").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Analyze").Select
Range("E36").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub