Update Record.

vmjan02

Well-known Member
Joined
Aug 15, 2012
Messages
1,132
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
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.

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
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Forum statistics

Threads
1,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

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