Results 1 to 11 of 11

VBA code to copy and paste data in one sheet from multiple sheet and loop through

Threaded View

  1. #5
    Registered User
    Join Date
    12-27-2012
    Location
    Việt Nam
    MS-Off Ver
    Excel 365
    Posts
    28

    Re: VBA code to copy and paste data in one sheet from multiple sheet and loop through

    I see the sheets for 2006-2013 are the same size, maybe this code:
    Sub Button1_Click()
    Dim ws As Worksheet, n%
    For Each ws In ThisWorkbook.Sheets
        If ws.Name <> "allyears" Then
            n = n + 1
            With Sheets("allyears")
                .Range("A3").Offset(0, n).Value = ws.Name
                .Range("A4:A57").Offset(0, n).Value _
                = ws.Range("B11:B64").Value
            End With
        End If
    Next ws
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Code for Multiple sheet Pivot Table Data copy and paste to another sheet
    By neeraj1418 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-13-2021, 06:46 AM
  2. For Loop to Copy Paste Data from sheet to another
    By stein7 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-22-2019, 04:56 AM
  3. VBA code to read data and paste in other sheet using a loop.
    By aleenkhan in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-21-2018, 03:01 PM
  4. [SOLVED] How to write a code within a loop to copy and paste rows on to another Sheet
    By swade730 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-24-2014, 08:40 PM
  5. [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
  6. Replies: 1
    Last Post: 03-28-2013, 02:49 PM
  7. copy paste data with multiple selected ranges from sheet to sheet
    By sivdin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-14-2011, 02:45 PM

Tags for this Thread

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