Niraj Baraili
Member
Hi All,
I have two workbooks(Rawdata and Summary) with sheets name 1300,1301,1302,1310,1300.I need to copy data from each Rawdata
sheets and paste it in summary sheets with same sheet name.
For example, if from 1300 sheets from Rawdata is copied and it has to be paste in Summary with the name 1300.
I tried with the below codes, but no lucks.
But, in the above process, whole sheets get selected in the summary.xlsm which i don't want. Instead of this, it should copy data from 1300 to 1300. Any help is appreciated ?
Mod Edit: Code tags added. Please use the [code] and [/code] tags in the future.
I have two workbooks(Rawdata and Summary) with sheets name 1300,1301,1302,1310,1300.I need to copy data from each Rawdata
sheets and paste it in summary sheets with same sheet name.
For example, if from 1300 sheets from Rawdata is copied and it has to be paste in Summary with the name 1300.
I tried with the below codes, but no lucks.
Code:
Dim Wb1 As Workbook
Dim Wb2 As Workbook
Dim Ws_1 As Variant
Dim i As Integer
Dim X As String
X = Format(Workbooks("summary.xlsm").Worksheets("1300").Range("B2").Value2, "m/d/yyyy")
Ws_1 = Array("1300", "1301", "1310", "1311", "1320", "1330")
path = "C:\Users\niraj.baraili\Desktop\check\"
ChDir path
Set Wb2 = Workbooks.Open(Filename:="Rawdata.xlsx")
Wb2.Activate
For i = LBound(Ws_1) To UBound(Ws_1)
Cells.Find(What:="Totals", After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Workbooks("Summary.xlsm").Activate
Sheets(Ws_1).Select
Cells.Find(What:=X, After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 67).Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Next i
End Sub
But, in the above process, whole sheets get selected in the summary.xlsm which i don't want. Instead of this, it should copy data from 1300 to 1300. Any help is appreciated ?
Mod Edit: Code tags added. Please use the [code] and [/code] tags in the future.
Attachments
Last edited by a moderator: