RCONDADO
New Member
- Joined
- Nov 4, 2014
- Messages
- 13
- Office Version
- 365
- Platform
- Windows
Hi friends!
To paste only values on the visible cells, i use the following macro:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Sub Copy_Filtered_Cells()
Dim from As Variant
Dim too As Variant
Dim thing As Variant
Dim cell As Range
'Selection.SpecialCells(xlCellTypeVisible).Select
Set from = Selection.SpecialCells(xlCellTypeVisible)
Set too = Application.InputBox("Select range to copy selected cells to ( Visible cells only)", Type:=8)
For Each cell In from
cell.Copy
For Each thing In too
If thing.EntireRow.RowHeight > 0 Then
thing.PasteSpecial(xlPasteValues)
Set too = thing.Offset(1).Resize(too.Rows.Count)
Exit For
End If
Next
Next
End Sub
[/TD]
[/TR]
</tbody>[/TABLE]
However, this macro works just for one column. Please, do you know how can i need write to make this macro work in two or more columns?
Thanks in advance!
Att.,
Rafael C.
To paste only values on the visible cells, i use the following macro:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Sub Copy_Filtered_Cells()
Dim from As Variant
Dim too As Variant
Dim thing As Variant
Dim cell As Range
'Selection.SpecialCells(xlCellTypeVisible).Select
Set from = Selection.SpecialCells(xlCellTypeVisible)
Set too = Application.InputBox("Select range to copy selected cells to ( Visible cells only)", Type:=8)
For Each cell In from
cell.Copy
For Each thing In too
If thing.EntireRow.RowHeight > 0 Then
thing.PasteSpecial(xlPasteValues)
Set too = thing.Offset(1).Resize(too.Rows.Count)
Exit For
End If
Next
Next
End Sub
[/TD]
[/TR]
</tbody>[/TABLE]
However, this macro works just for one column. Please, do you know how can i need write to make this macro work in two or more columns?
Thanks in advance!
Att.,
Rafael C.