Paste Only Values on the Visible Cells in Two or More Collumns

RCONDADO

New Member
Joined
Nov 4, 2014
Messages
13
Office Version
  1. 365
Platform
  1. Windows
Hi friends!


To paste only values on the visible cells, i use the following macro:

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

<tbody>
</tbody>



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.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,215,267
Messages
6,123,964
Members
449,137
Latest member
yeti1016

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top