+ Reply to Thread
Results 1 to 33 of 33

Excel Sheets data copy and paste into one sheet

Hybrid View

sudbhavani Excel Sheets data copy and... 05-09-2017, 01:32 AM
Sintek Re: Excel Sheets data copy... 05-09-2017, 01:34 AM
sudbhavani Re: Excel Sheets data copy... 05-09-2017, 02:07 AM
sudbhavani Re: Excel Sheets data copy... 05-09-2017, 05:00 AM
Sintek Re: Excel Sheets data copy... 05-09-2017, 05:15 AM
Sintek Re: Excel Sheets data copy... 05-09-2017, 05:47 AM
sudbhavani Re: Excel Sheets data copy... 05-10-2017, 12:35 AM
Sintek Re: Excel Sheets data copy... 05-10-2017, 12:46 AM
sudbhavani Re: Excel Sheets data copy... 05-10-2017, 01:02 AM
Sintek Re: Excel Sheets data copy... 05-10-2017, 02:14 AM
sudbhavani Re: Excel Sheets data copy... 05-10-2017, 02:29 AM
Sintek Re: Excel Sheets data copy... 05-10-2017, 02:38 AM
sudbhavani Re: Excel Sheets data copy... 05-10-2017, 02:53 AM
Sintek Re: Excel Sheets data copy... 05-10-2017, 03:43 AM
sudbhavani Re: Excel Sheets data copy... 05-10-2017, 04:09 AM
Sintek Re: Excel Sheets data copy... 05-10-2017, 03:18 AM
sudbhavani Re: Excel Sheets data copy... 05-10-2017, 03:25 AM
sudbhavani Re: Excel Sheets data copy... 05-10-2017, 04:08 AM
Sintek Re: Excel Sheets data copy... 05-10-2017, 04:16 AM
sudbhavani Re: Excel Sheets data copy... 05-10-2017, 04:17 AM
Sintek Re: Excel Sheets data copy... 05-10-2017, 04:21 AM
sudbhavani Re: Excel Sheets data copy... 05-10-2017, 04:27 AM
Sintek Re: Excel Sheets data copy... 05-10-2017, 04:41 AM
sudbhavani Re: Excel Sheets data copy... 05-10-2017, 04:45 AM
Sintek Re: Excel Sheets data copy... 05-10-2017, 04:48 AM
sudbhavani Re: Excel Sheets data copy... 05-10-2017, 04:57 AM
Sintek Re: Excel Sheets data copy... 05-10-2017, 04:46 AM
Sintek Re: Excel Sheets data copy... 05-10-2017, 05:01 AM
sudbhavani Re: Excel Sheets data copy... 05-10-2017, 05:09 AM
sudbhavani Re: Excel Sheets data copy... 05-10-2017, 05:15 AM
Sintek Re: Excel Sheets data copy... 05-10-2017, 05:16 AM
sudbhavani Re: Excel Sheets data copy... 05-10-2017, 05:18 AM
Sintek Re: Excel Sheets data copy... 05-10-2017, 05:27 AM
  1. #1
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,957

    Re: Excel Sheets data copy and paste into one sheet

    PS....I noticed that you would like to increment the inputs in Column A
    Substitute with this code:
    Option Explicit
    
    Private Sub CommandButton1_Click()
    Dim CopyFromPath As String, FileName As String, sNo As Long
    Dim CopyFrom As Workbook, CopyToWb As Workbook, wb As Workbook
    Dim rngNames As Range, rng As Range
    Dim lRow As Long, nextrow As Long, r As Long, lRow2 As Long
    Application.ScreenUpdating = False
    CopyFromPath = "C:\Users\Sintek\Desktop\Reports\"
    Set CopyToWb = Workbooks("Copy of Mainsheet.xlsm")
    FileName = Dir(CopyFromPath & "*.xlsx")
    
    Do While Len(FileName) > 0
        Set wb = Workbooks.Open(CopyFromPath & FileName)
        
        With wb.Sheets("Sheet1")
            lRow = .Cells(Rows.Count, "A").End(xlUp).Row
            For r = 2 To lRow
                .Range("B" & r & ":Z" & r).Copy
                nextrow = CopyToWb.Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row + 1
                 CopyToWb.Sheets("Sheet1").Range("B" & nextrow).PasteSpecial xlPasteAll
                CopyToWb.Sheets("Sheet1").Range("A" & nextrow) = nextrow - 1
            Next r
                Application.CutCopyMode = False
                wb.Close saveChanges:=False
        End With
        
        FileName = Dir
    Loop
    Application.ScreenUpdating = True
    'ActiveWorkbook.Close saveChanges:=True
    End Sub
    Attached Files Attached Files
    Last edited by Sintek; 05-10-2017 at 12:47 AM.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Copy and Paste data automatically from master sheet to other sheets
    By wschleis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-18-2014, 04:29 PM
  2. [SOLVED] insert sheets 2 & 3 and copy & paste data from the first sheet
    By RobinPrice in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-14-2014, 12:24 AM
  3. [SOLVED] VBA Code to copy data from one sheet and paste to multiple other sheets
    By JimmyG. in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-17-2013, 04:25 AM
  4. Need macro to copy data from one sheet and paste to many sheets
    By Gillesrd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-28-2013, 10:39 PM
  5. Macro to copy and paste 70+ sheets of data onto 1 sheet
    By Helenew698 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 06-30-2012, 01:49 PM
  6. Copy data in multiple sheets and paste into one sheet.
    By Slomaro2000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-05-2008, 05:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1