Copy and paste visible cells on every other cell in a column

geh17

New Member
Joined
Oct 8, 2015
Messages
8
Hi guys,

Hope you can provide some help with vba. Each visible cell in a column will be copied and pasted on every other cell in a column in another sheet. For example, after filtering cells on sheet1, visible cells that will be copied are A3, A10, A14, A19, A27, etc. Each of these visible cells will be pasted one by one on every other cell in sheet2 column B which starts on B1 then B3, B5, B7, B9, and so on. Thank you so much.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
How about
Rich (BB code):
Sub geh17()
   Dim Rng As Range, Cls As Range, Cl As Range
   Dim i As Long
   
   With Sheets("Sheet1")
      Set Rng = .Range("A2", .Range("A" & Rows.Count).End(xlUp)).SpecialCells(xlVisible)
   End With
   With Sheets("Sheet2")
      For Each Cls In Rng.Areas
         For Each Cl In Cls
            i = i + 1
            .Cells(i * 2 - 1, 1) = Cl
         Next Cl
      Next Cls
   End With
   
End Sub
change sheet names to suit
 
Upvote 0
How about
Rich (BB code):
Sub geh17()
   Dim Rng As Range, Cls As Range, Cl As Range
   Dim i As Long
  
   With Sheets("Sheet1")
      Set Rng = .Range("A2", .Range("A" & Rows.Count).End(xlUp)).SpecialCells(xlVisible)
   End With
   With Sheets("Sheet2")
      For Each Cls In Rng.Areas
         For Each Cl In Cls
            i = i + 1
            .Cells(i * 2 - 1, 1) = Cl
         Next Cl
      Next Cls
   End With
  
End Sub
change sheet names to suit


Thank you very much @Fluff!
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,215,055
Messages
6,122,902
Members
449,097
Latest member
dbomb1414

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