Meathead2022
New Member
- Joined
- Oct 23, 2021
- Messages
- 2
- Office Version
- 2019
- 2016
- Platform
- 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
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
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