Hi,
my worksheet has monthly data from Jan-latest (dec 2022).
I need to paste new data at Dec 2022. ie; my last data is on 16th Dec and I want to replace 16th dec data with 23rd dec data.
What is the code that i should try?
now my code is:
Sub FI_Val()
'Open Valaution workbook
Workbooks.Open Filename:= _
"Valuation " & WorksheetFunction.Text(Sheet5.Range("DY1"), "yyyymmdd") & ".xls"
File_name = Right(file_dir, 23)
Range("A2:cc2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("Workbook" & ".xlsm").Activate
Worksheets("Valuation").Activate
'Find Date and Local Bond only
Dim ExactDate As Date
Dim sDate As String
Dim EDate As Long
ExactDate = Range("DY1").Value
EDate = ExactDate
Range("C:C").AutoFilter
Range("C:C").AutoFilter Field:=1, Criteria1:=">=" & EDate
Range("CP:CP").AutoFilter
Range("CP:CP").AutoFilter Field:=1, Criteria1:="Local Bond"
I'am stuck which i need the macro to find the date and paste the data at that date
my worksheet has monthly data from Jan-latest (dec 2022).
I need to paste new data at Dec 2022. ie; my last data is on 16th Dec and I want to replace 16th dec data with 23rd dec data.
What is the code that i should try?
now my code is:
Sub FI_Val()
'Open Valaution workbook
Workbooks.Open Filename:= _
"Valuation " & WorksheetFunction.Text(Sheet5.Range("DY1"), "yyyymmdd") & ".xls"
File_name = Right(file_dir, 23)
Range("A2:cc2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Windows("Workbook" & ".xlsm").Activate
Worksheets("Valuation").Activate
'Find Date and Local Bond only
Dim ExactDate As Date
Dim sDate As String
Dim EDate As Long
ExactDate = Range("DY1").Value
EDate = ExactDate
Range("C:C").AutoFilter
Range("C:C").AutoFilter Field:=1, Criteria1:=">=" & EDate
Range("CP:CP").AutoFilter
Range("CP:CP").AutoFilter Field:=1, Criteria1:="Local Bond"
I'am stuck which i need the macro to find the date and paste the data at that date