Automatic Transfer to a different sheet and a different column

Meathead2022

New Member
Joined
Oct 23, 2021
Messages
2
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Hey guys.

I need to transfer a whole bunch of data from one sheet into another sheet of the same name of the data i am transferring.

For example: if the data in column A of the sheet Named Roster says Sheet1 then the whole row with Sheet1 Needs to go into the Sheet named Sheet1
if the data in column A of the sheet Named Roster says Sheet2 then the whole row with Sheet2 Needs to go into the Sheet named Sheet2 ... etc

I need the data to land in Column W though can someone look at the example script I have posted and help me refigure it so the data goes into column W3 instead of a4

cheers

VBA Code:
Sub Records()
    Dim wsRng As Range, i As Long
    Application.ScreenUpdating = False

    Set wsRng = Sheets("Records").Range("A2:A" & Sheets("Records").Range("A" & Rows.Count).End(xlUp).Row)
    For i = 1 To ThisWorkbook.Worksheets.Count


        If Worksheets(i).Name <> "Records" Then

            With wsRng
                .AutoFilter 1, Worksheets(i).Name
                On Error Resume Next
                .Offset(1).Resize(.Rows.Count - 1).SpecialCells(12).EntireRow.Copy _
                        Worksheets(i).Range("A" & Worksheets(i).Rows.Count).End(xlUp).Offset(1)
                On Error GoTo 0
            End With
            If Application.WorksheetFunction.CountA(Worksheets(i).Rows(1)) = 0 Then Worksheets(i).Rows(1).Delete
        End If
    Next

    wsRng.AutoFilter
    Application.ScreenUpdating = True
End Sub

Because the data I have is confidential, I have created a replica sheet (i know i forgot to create sheet1 *idiot*). But any help would be awesome.

Cheers guys


Screenshot (6).png
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
You said:
if the data in column A of the sheet Named Roster says Sheet2 then the whole row with Sheet2 Needs to go into the Sheet named Sheet2 ... etc

But then you said:
I need the data to land in Column W though
You cannot copy a entire row to be copied into Column W
If we copy the entire row then we stat the copying into Column A
 
Upvote 0
There is already data in the sheets it is being transferred to. So columns A to V have information in them I need to copy the data after that so in W.

So if i was going to copy data for example column A to Column H is there a way to do that ?
 
Upvote 0

Forum statistics

Threads
1,214,424
Messages
6,119,407
Members
448,894
Latest member
spenstar

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