matosimone
New Member
- Joined
- Mar 1, 2013
- Messages
- 40
Hi guys!
Im having some trouble with this macro. Ive merged 180 excel files (1 sheet per file) using a macro and it went fine. Now I need to perfom a simple copy paste in each sheet, im using the following macro, but it will only work in the first sheet. I can see it goes though all the different sheets (180), and I can even see it selects the right columns but nothing gets copy/pasted.
This is the code:
Any ideas in what could be going wrong?
Thanks!
MAto
Im having some trouble with this macro. Ive merged 180 excel files (1 sheet per file) using a macro and it went fine. Now I need to perfom a simple copy paste in each sheet, im using the following macro, but it will only work in the first sheet. I can see it goes though all the different sheets (180), and I can even see it selects the right columns but nothing gets copy/pasted.
This is the code:
Code:
Sub Copy()
Dim WS_Count As Integer
Dim I As Integer
WS_Count = ActiveWorkbook.Worksheets.Count
For I = 1 To WS_Count
Range("D:D,P:P,Q:Q").Select
Selection.Copy
Columns("V:V").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Next I
End Sub
Any ideas in what could be going wrong?
Thanks!
MAto