Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
Code copies twice...?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Howard, post: 7424302"] I'll give your suggestion a go, I'm sure it will work. I have tried this worksheet array and the new problem with it is that I only get the Sheet 3 data copied into Sheet 4. I'm thinking the advantage here is that the sheet selection and the sheet order can be adjusted in the array. Say Worksheets(Array("Sheet3", "Sheet6", "Sheet1")) (Omitting sheets 1, 2 from the copy to sheet 4) Does that make any sense? Howard Sub ThreeColumnsToOne() Dim lastRow As Long, lastRowDest As Long Dim sh As Worksheet Application.ScreenUpdating = False For Each sh In Worksheets(Array("Sheet1", "Sheet2", "Sheet3")) lastRowDest = 1 lastRow = sh.Range("A" & Rows.Count).End(xlUp).Row sh.Range("A1:A" & lastRow).Copy Destination:=Sheets("Sheet4").Range("A" & lastRowDest) lastRowDest = Sheets("Sheet4").Range("A" & Rows.Count).End(xlUp).Row + 1 Next Application.ScreenUpdating = True MsgBox "Done!" End Sub [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
Code copies twice...?
Top