Hi,
I am looking for a code which select data from data tab and paste in Final tab as per creteria mention in Selection tab.
Sheet attached
Thank you
Hi,
I am looking for a code which select data from data tab and paste in Final tab as per creteria mention in Selection tab.
Sheet attached
Thank you
.
Here is a variation of your project. Will this work ?
Option Explicit Sub CopyInfo() Dim wkSht As Worksheet Dim cell As Range Dim nextRow As Long Dim lRow As Long Dim i As Integer Dim celltxt As String Dim celltxtval As String Dim cellyearval As String Application.ScreenUpdating = False lRow = Sheets("Data").Cells(Rows.Count, "A").End(xlUp).Row For Each wkSht In Sheets Sheets("Data").Activate For i = 2 To lRow If Sheets("Data").Range("A" & i).Value = wkSht.Name Then Sheets("Data").Activate nextRow = wkSht.Range("A" & Rows.Count).End(xlUp).Row + 1 Sheets("Data").Range("A" & i).EntireRow.Copy Destination:=wkSht.Range("A" & nextRow) End If Next i Next wkSht Application.ScreenUpdating = True End Sub
That is good and working fine but I have different requirement...I want one name to be added in another one.....Like if we select FGT data, then its data should be added in HYT and then make FGT data zero after adding to HYT...so may be that can be done just by applying simple sum formula...so what exactly needed is FGT data should pasted in Final sheet in A2 cell onwards and HYT data in A8 cell onwards....then A16 onwards we have sum formula..then this A16 data should replace data of HYT and make FGT data zero...and last thing we don't want to select every row in FGT..only row for Mkt and Fin in Dept. I am also working on this...will update if I get something
Adding another attachment
.
I apologize. I am totally confused now.
Sorry for the confusion,,,let me try to explain it agian.
ok what is needed is...code will select name as per selection tab..so now we want 2 names in final sheet.
First data from data sheet will pated in first table lets say data for FGT or Fin & Mkt dept only...second name data from data sheet will pasted in 2nd table in final sheet lets say for HYT again for Fin & Mkt dept only (i have highlighted them in Attahed new sheet)
3rdtable in fnal sheet is sum of FGT and HYT
Now last thing we want....FGT data should be zero in data sheet for Fin & Mkt dept and for HYT new sum data of 3rd table will replace it.
I hope this time itmake sense..thanks
Attached new sheet
Until now i am come up with this.....it is pasting whole data as per their respective names in selection data to final sheet.
But i need only 2 dept names data Fin & Mkt and then 3rd table data of final sheet will replace HYT data in data sheet.
and make all FGT data zero in Data sheet for FIin Mkt dept.