Hi all
What I have is Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
I would also like to paste values only is this possible the full code is below
Many thanks in advance
Sub CopySheet2ToSheet5555()
Dim wbBook As Workbook
Dim wsSheet2 As Worksheet, wsSheet5 As Worksheet
Dim rnSource As Range, rnTarget As Range
Dim r As Long, x As Long
Set wbBook = ThisWorkbook
Set wsSheet2 = wbBook.Worksheets("parts dimensions")
Set wsSheet5 = wbBook.Worksheets("data collection1")
Sheets("Parts dimensions").Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Set rnSource = wsSheet2.Range("2:500")
r = rnSource.Rows.Count
For x = 1 To r
If Application.CountA(rnSource.Rows(x)) <> 0 Then
Set rnTarget = wsSheet5.Range("a65536").End(xlUp).Offset(1, 0)
rnSource.Rows(x).Copy rnTarget
Sheets("Cabinets").Select
End If
Next
End Sub
What I have is Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
I would also like to paste values only is this possible the full code is below
Many thanks in advance
Sub CopySheet2ToSheet5555()
Dim wbBook As Workbook
Dim wsSheet2 As Worksheet, wsSheet5 As Worksheet
Dim rnSource As Range, rnTarget As Range
Dim r As Long, x As Long
Set wbBook = ThisWorkbook
Set wsSheet2 = wbBook.Worksheets("parts dimensions")
Set wsSheet5 = wbBook.Worksheets("data collection1")
Sheets("Parts dimensions").Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Set rnSource = wsSheet2.Range("2:500")
r = rnSource.Rows.Count
For x = 1 To r
If Application.CountA(rnSource.Rows(x)) <> 0 Then
Set rnTarget = wsSheet5.Range("a65536").End(xlUp).Offset(1, 0)
rnSource.Rows(x).Copy rnTarget
Sheets("Cabinets").Select
End If
Next
End Sub