Sandie1712
New Member
- Joined
- Aug 10, 2017
- Messages
- 33
Hello,
i am very new to VBA coding and trying to select all the cells in below mentioned code."cells.select"
But it's giving error"Run time error 1004" could you pl suggest the solution.
Thanks!!
i am very new to VBA coding and trying to select all the cells in below mentioned code."cells.select"
But it's giving error"Run time error 1004" could you pl suggest the solution.
Thanks!!
Code:
Sub copyfromallopenworkbookstooneworkbook()
Dim wb As Workbook, ws As Worksheet, j As Long
j = 1
For Each wb In Workbooks
wb.Activate
'MsgBox wb.Name
For Each ws In Worksheets
ws.Select
'MsgBox ws.Name
Cells.Select
Selection.Copy
ThisWorkbook.Activate
Sheets(j).Select
Range("A1").Select
ActiveCell.PasteSpecial xlPasteValues
ws.Activate
j = j + 1
wb.Activate
Next
Next
ThisWorkbook.Activate
End Sub
Last edited by a moderator: