Copy Paste visible cells only to a specific column? (subtotal-ed data)

VBAWannabee2

New Member
Joined
Feb 23, 2022
Messages
28
Office Version
  1. 2010
Platform
  1. Windows
Good day!

Hi, need a little help on this one, how can I copy and paste visible cells to another column?
The data attached was subtotaled. I want to copy the values of Column E (visible only) then paste it on Column F respectively.
I'm still learning VBA and I can't execute this one. Missing the last line of my mini-code.

VBA Code:
Sub TestCopy()

Range("E1", Range("E1").End(xlDown)).Select
selection.SpecialCells(xlCellTypeVisible).Copy

End Sub

Any help will do, thanks and cheers!
1652169468137.png
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
See if this helps:
 
Upvote 0
How about
VBA Code:
Sub VBAWannabee()
   Dim Rng As Range
   
   For Each Rng In Range("E2", Range("E" & Rows.Count).End(xlUp)).SpecialCells(xlVisible).Areas
      Rng.Offset(, 1).Value = Rng.Value
   Next Rng
End Sub
 
Upvote 0
Solution
See if this helps:
Hi @Akuini, thank you for the help but I think I'll go with Mr. Fluff. Cheers!!
 
Upvote 0
How about
VBA Code:
Sub VBAWannabee()
   Dim Rng As Range
  
   For Each Rng In Range("E2", Range("E" & Rows.Count).End(xlUp)).SpecialCells(xlVisible).Areas
      Rng.Offset(, 1).Value = Rng.Value
   Next Rng
End Sub
Hi Mr. @Fluff ! Thanks for this one, I just changed a little bit on your code and it works perfectly. Cheers!
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,177
Members
452,615
Latest member
bogeys2birdies

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