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

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,214,535
Messages
6,120,090
Members
448,944
Latest member
sharmarick

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