Results 1 to 3 of 3

Look through Sheets for specific values if found then copy and paste in another sheet

Threaded View

  1. #1
    Registered User
    Join Date
    01-05-2022
    Location
    London
    MS-Off Ver
    16.0.13801.21072
    Posts
    14

    Look through Sheets for specific values if found then copy and paste in another sheet

    I'm struggling to look through all sheets within a workbook. If within a Sheet in column A Value 08 or 09 is found then copy entire row (where the value was found) in Sheet1.
    I'm also trying to copy all values below each other.

    Thank you

    Sub CopyRows()
        Sheets("Sheet1").Select
        ' Find the last row of data
        FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
        ' Loop through each row
        For i = 2 To FinalRow
            ' Decide if to copy based on column D
            ThisValue = Cells(i, 1).Value
            If ThisValue = "08" Or "09" Then
            Worksheets("Sheet1 (401)").Range("A9").Copy Worksheets("Sheet1").Range("A1")
                 
        Next i
    End Sub
    Example.xlsx
    Last edited by Geodav; 09-06-2022 at 09:20 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA Combine multiple sheets onto one sheet for a specific column range and paste as values
    By Dahya in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-14-2021, 05:54 AM
  2. Copy 2 specific Sheets, specified range, paste as values to a specific folder
    By wherdzik in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-04-2021, 08:35 AM
  3. Replies: 11
    Last Post: 10-19-2016, 10:47 PM
  4. Loop through all sheets and copy and paste values for specific formula
    By SAFC in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-17-2015, 08:17 AM
  5. [SOLVED] Copy paste values from sheets into one master sheet
    By nickmax1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-20-2013, 10:52 AM
  6. Need to copy ranges from multiple sheets then paste to sheet under specific headers
    By the duke in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-13-2013, 12:17 AM
  7. macro to copy specific data from one sheet and paste into two sheets
    By Shogun in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-26-2009, 04:56 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