+ Reply to Thread
Results 1 to 8 of 8

Copy data from multiple sheets to one main based on cell value

Hybrid View

  1. #1
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Copy data from multiple sheets to one main based on cell value

    See attached file. You have to run the macro called Sold_Transfer. You can click on the Data menu and then on the Macros menu on the far right of the menubar. Then select the macro name and click on Execute.
    Here is the macro:
    Sub Sold_Transfer()
    '
    Dim S_heet As Worksheet, C_ell As Range
    '
    For Each S_heet In Application.Worksheets
      If S_heet.Name <> "MAIN" Then
        S_heet.Activate
        For Each C_ell In Range("B3", Cells(Rows.Count, 2).End(xlUp))
          If C_ell.Offset(0, 5) = "Sold" Then
            C_ell.Resize(1, 4).Copy
            Sheets("Main").Cells(Rows.Count, 2).End(xlUp).Offset(1, 0).PasteSpecial
            Application.CutCopyMode = False
            Sheets("Main").Cells(Rows.Count, 2).End(xlUp).Offset(0, 5) = C_ell.Offset(0, 6)
          End If
        Next
      End If
    Next
    End Sub
    Attached Files Attached Files
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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