Jyotirmaya
Board Regular
- Joined
- Dec 2, 2015
- Messages
- 205
- Office Version
- 2019
- Platform
- 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 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.
Raw Data
example sheet
example sheet
Abstract Sheet