Copy Rows based on cell value to match with tab name

Apple08

Active Member
Joined
Nov 1, 2014
Messages
450
Hi All

I need to copy the row data from "Sheet 8" to "Sheet 1", "Sheet 2", "Sheet 3", "Sheet 4" and "Sheet 5" based on the column A cell value of "Sheet 8". If the cell value is matched with the tab name, e.g. Sheet 1, then the whole row of content will be copied to the worksheet "Sheet 1" from row 2 as there is a header row for all worksheets. The number of rows in "Sheet 8" is unknown.

I wonder is anyone able to help. Many thanks.
 
Try this:
Run this script from the sheet named "Sup Tracker" with your sheet names in column A
I assume you have a header row in sheet named "Sup Tracker" so search starts in row(2)

VBA Code:
Sub Filter_Me_Please_Array()
'Modified  4/14/2021  6:30:25 AM  EDT
Dim Del As Variant
Del = Array("STEM", "FASS", "WELS", "PVC-S", "FBL") ' Modify Sheet names if needed
Dim lastrow As Long
Dim ans As Long
ans = UBound(Del)
Dim c As Long
Dim counter As Long
counter = 0
c = "1" ' Column Number Modify this to your need
lastrow = Cells(Rows.Count, c).End(xlUp).Row

With Sheets("SUP Tracker").Cells(1, c).Resize(lastrow)

For i = 0 To ans
    .AutoFilter 1, Del(i), Operator:=xlFilterValues
    counter = .Columns(c).SpecialCells(xlCellTypeVisible).Count
    If counter > 1 Then .Offset(1).Resize(.Rows.Count - 1).SpecialCells(xlCellTypeVisible).EntireRow.Copy Sheets(Del(i)).Cells(2, 1)
counter = 0
Next
.AutoFilter
End With
End Sub
Wow it works like a magic! I really appreciate your help very much! Thank you for spending your time and effort to help me. You are a star! :)
 
Upvote 0

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Wow it works like a magic! I really appreciate your help very much! Thank you for spending your time and effort to help me. You are a star! :)
Glad I was able to help you.
Come back here to Mr. Excel next time you need additional assistance.
 
Upvote 0
Glad I was able to help you.
Come back here to Mr. Excel next time you need additional assistance.
Hello, please advice me how to prevent overwrite data, but add new row with it? Thx
 
Upvote 0
Hello, please advice me how to prevent overwrite data, but add new row with it? Thx
Forum rules require that you start a new posting. So, write a new posting give specific details of what you have and what you now need. Please give specifics like sheet names and Column numbers if needed. Do not say "the other sheet" or column "Dates". And when I see your posting, I will try to help you. Take care and I hope I or someone else here will be able to help you
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,209
Members
453,022
Latest member
RobertV1609

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top