Copy rows to different sheets if sheet name matches with Text of A column Tweak required

Jyotirmaya

Board Regular
Joined
Dec 2, 2015
Messages
205
Office Version
  1. 2019
Platform
  1. Windows
Code:
Sub CopyRowDemo()
Dim Rw As Long, LstRwRaw As Long, NxtRwDest As Long
Application.ScreenUpdating = False
LstRwRaw = Sheets("Raw Data").Cells(Rows.Count, "B").End(xlUp).Row
For Rw = 3 To LstRwRaw
    With Sheets(Cells(Rw, "B").Value)
        If .Range("B6") = "" Then
            NxtRwDest = 6
        Else
            NxtRwDest = .Cells(Rows.Count, "B").End(xlUp).Row + 1
        End If
        Rows(Rw).Copy .Cells(NxtRwDest, "A")


        With .Cells(NxtRwDest + 1, "G")
            .Formula = "=Sum(G6:G" & NxtRwDest & ")"
            .Font.Bold = True
            .Copy .Offset(, 1).Resize(, 26)
        End With

    End With
Next Rw
Application.ScreenUpdating = True
End Sub
I have 100+ sheets in excel & the main data sheet is named as "raw data". I have to copy rows from "raw data" sheet to every sheet if the text of Column B matches with the sheet name.
I am using the above code to copy the data from Raw Data sheet to different sheet from G to AG row starting from pasting the data B6 onward in respective sheet. With the above code I am getting the sum of all the sheets below the data.

I need some more tweaks in the code

1. I want a merged Text "TOTAL" in A to F column in each sheet.
2. I have an another sheet named "Abstract" where I want to automatically link the TOTAL of each sheet on C onward.
For example in the Abstract sheet, those sheets TOTAL will be linked which Sheet names are there in the Sheet.

For example as per the picture uploaded I have a sheet named Stars but as the name Star is not present in the Abstract sheet that sheet total is not required to be linked.

And again a TOTAL of the abstract sheet is required.

What should be the change in the code required ? kindly check the images to understand better.
1m.JPG


Raw Data

3.JPG


example sheet


4.JPG


example sheet

5.JPG


Abstract Sheet
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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