I have this code and this is all perfect it is copy and pasting the data from 1 file and other file (other file has multi sheets)
for each sheet in other file i have date column, not shre as just need to modif the current code, so that if will check the date, if found over right the data, if not thenpast it in last blank cell,
so it should check the date first if found over right it, if not then copy and past for all the sheets.
for each sheet in other file i have date column, not shre as just need to modif the current code, so that if will check the date, if found over right the data, if not thenpast it in last blank cell,
so it should check the date first if found over right it, if not then copy and past for all the sheets.
Date |
12-09-2023 |
13-09-2023 |
14-09-2023 |
15-09-2023 |
16-09-2023 |
17-09-2023 |
18-09-2023 |
19-09-2023 |
20-09-2023 |
21-09-2023 |
22-09-2023 |
23-09-2023 |
24-09-2023 |
25-09-2023 |
26-09-2023 |
27-09-2023 |
28-09-2023 |
29-09-2023 |
30-09-2023 |
01-10-2023 |
02-10-2023 |
03-10-2023 |
04-10-2023 |
05-10-2023 |
06-10-2023 |
07-10-2023 |
08-10-2023 |
09-10-2023 |
10-10-2023 |
11-10-2023 |
12-10-2023 |
13-10-2023 |
14-10-2023 |
15-10-2023 |
VBA Code:
Sub copypasttomaster()
Dim WbSource As Workbook
Dim Fpath As String
Dim rdate As Date
Dim Fname As String
Fpath = ActiveWorkbook.Path
Fname = Dir(Fpath & "\" & "Daily-complainys.xlsx")
Windows("Fixed FTTH CBU Tech Compliants V1.xlsm").Activate
ActiveWorkbook.Sheets("Table").Activate
ActiveSheet.Range("D10:K10").Copy
Set WbSource = Workbooks.Open(Fpath & "\" & Fname)
Windows(Fname).Activate
'''''''''''''''''''''''
'
' data for sheet "Per-Area-type"
'
''''''''''''''''''''''''
Application.Wait (Now + TimeValue("0:00:02"))
Sheets("Per-Area-type").Activate
Range("A" & Cells.Rows.Count).End(xlUp).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Windows("Fixed FTTH CBU Tech Compliants V1.xlsm").Activate
ActiveWorkbook.Sheets("Table").Activate
ActiveSheet.Range("O10:Q10").Copy
Windows(Fname).Activate
'''''''''''''''''''''''
'
' data for sheet "CC and repeat count"
'
''''''''''''''''''''''''
Sheets("CC and repeat count").Activate
Range("A" & Cells.Rows.Count).End(xlUp).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Windows("Fixed FTTH CBU Tech Compliants V1.xlsm").Activate
ActiveWorkbook.Sheets("Table").Activate
ActiveSheet.Range("U10:AB10").Copy
Windows(Fname).Activate
'''''''''''''''''''''''
'
' data for sheet "More-than-two-ser-sub"
'
''''''''''''''''''''''''
Application.Wait (Now + TimeValue("0:00:02"))
Sheets("More-than-two-ser-sub").Activate
Range("A" & Cells.Rows.Count).End(xlUp).Offset(1, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
end sub