Hi all,
I have seen many posts about changing a date from DD/MM/YY format to YYMMDD format; however, there has been a number of solutions and i have tried to implement some but to no avail.
I want to paste into a format with no "/"s, just YYMMDD and for example, if it was 12/09/17 it would come out with 170912.With a 0 before the 9.
The date in the previous document has been pulled out of a much longer code using the =RIGHT(MatchStats2!A1,8) but is formatted as a date.
Any help would be greatly appreciated.
Many thanks,
Tom
I have seen many posts about changing a date from DD/MM/YY format to YYMMDD format; however, there has been a number of solutions and i have tried to implement some but to no avail.
I want to paste into a format with no "/"s, just YYMMDD and for example, if it was 12/09/17 it would come out with 170912.With a 0 before the 9.
Code:
[FONT=Menlo][COLOR=#011993]Sub[/COLOR] Copy1()[/FONT]
[FONT=Menlo]
[/FONT]
[COLOR=#008F00][FONT=Menlo]'Define Workbooks[/FONT][/COLOR]
[FONT=Menlo]
[/FONT]
[FONT=Menlo][COLOR=#011993]Dim[/COLOR] ActiveWbk [COLOR=#011993]As[/COLOR] Workbook[/FONT]
[FONT=Menlo][COLOR=#011993]Dim[/COLOR] ClosedWbk1 [COLOR=#011993]As[/COLOR] Workbook[/FONT]
[FONT=Menlo]
[/FONT]
[FONT=Menlo][COLOR=#011993]Dim[/COLOR] DateRef1 [COLOR=#011993]As[/COLOR] [COLOR=#011993]Date[/COLOR][/FONT]
[FONT=Menlo][COLOR=#011993]Dim[/COLOR] DateRef2 [COLOR=#011993]As[/COLOR] [COLOR=#011993]Date[/COLOR][/FONT]
[FONT=Menlo]
[/FONT]
[FONT=Menlo]Application.ScreenUpdating = [COLOR=#011993]False[/COLOR][/FONT]
[FONT=Menlo]Application.DisplayAlerts = [COLOR=#011993]False[/COLOR][/FONT]
[FONT=Menlo]
[/FONT]
[FONT=Menlo][COLOR=#011993]Set[/COLOR] ActiveWbk = ActiveWorkbook[/FONT]
[FONT=Menlo][COLOR=#011993]Set[/COLOR] ClosedWbk1 = Workbooks.Open("/Users/A3/Downloads/1.xls")[/FONT]
[FONT=Menlo]
[/FONT]
[FONT=Menlo]DateRef1 = ClosedWbk1.Sheets("Workings").Range("I3")[/FONT]
[FONT=Menlo]
[/FONT]
[FONT=Menlo]ActiveWbk.Activate[/FONT]
[FONT=Menlo]
[/FONT]
[FONT=Menlo]Sheets("Team Sheet Workings").Select[/FONT]
[FONT=Menlo]
[/FONT]
[FONT=Menlo]Range("C3") = DateRef1[/FONT]
[FONT=Menlo]
[/FONT]
[COLOR=#008F00][FONT=Menlo]'Second Team[/FONT][/COLOR]
[FONT=Menlo]
[/FONT]
[FONT=Menlo]DateRef2 = ClosedWbk1.Sheets("TeamOverview").Range("M2")[/FONT]
[FONT=Menlo]
[/FONT]
[FONT=Menlo]ActiveWbk.Activate[/FONT]
[FONT=Menlo]
[/FONT]
[FONT=Menlo]Sheets("Team Sheet Workings").Select[/FONT]
[FONT=Menlo]
[/FONT]
[FONT=Menlo]Range("D3") = DateRef2[/FONT]
[FONT=Menlo]
[/FONT]
[FONT=Menlo]ClosedWbk1.Close [COLOR=#011993]False[/COLOR][/FONT]
[FONT=Menlo]
[/FONT]
[FONT=Menlo]Range("C2").Select[/FONT]
[FONT=Menlo]
[/FONT]
[FONT=Menlo]Application.ScreenUpdating = [COLOR=#011993]True[/COLOR][/FONT]
[FONT=Menlo]Application.DisplayAlerts = [COLOR=#011993]True[/COLOR][/FONT]
[FONT=Menlo]
[/FONT]
[COLOR=#011993][FONT=Menlo]End[COLOR=#000000] [/COLOR]Sub[/FONT][/COLOR]
Any help would be greatly appreciated.
Many thanks,
Tom