I have two different worksheets and each sheet has dates in different format. Sheet1 dates are pulled from the system and shows up as '080215 (in general format and starts with single quote because it is pulled from the system)whereas Sheet2 has date in format 7/02/2008.
Here are the contents of Sheet1 (two columns)
Date Value
'080215 0.998602
'080214 1.002959
'080213 1.00065
'080212 1.003915
'080211 0.998253
'080208 1.000851
'080207 0.988582
'080206 0.997506
'080205 0.995718
Here are the contents of Sheet 2 (one column)
Date
5/2/2008
5/2/2008
5/2/2008
7/2/2008
7/2/2008
7/2/2008
8/2/2008
8/2/2008
8/2/2008
I need to insert second coloumn in Sheet 2 names as Values and populate the numbers in this field from “Value” column in Sheet1 corresponding to the respective dates. For example in Sheet 2, for date 5/2/2008 the value should be 0.995718 (which is against the same date in Sheet 1 i.e 080205)
I just roughly tried the Vlookup function in Excel but it fails to return the value because the date formats are different in both the sheets. If I manually change the dates in both the sheets to the same date format then the vlookup works.
However I actually need a VBA code for Excel to look up for those values in Sheet 2 as I am asked to develop a macro to populate the values in Sheet 2. I am a novice in coding/VBA so can not really understand how to make this work.
Please give some insight on the vba code for excel.
Thanks,
Peace77
Here are the contents of Sheet1 (two columns)
Date Value
'080215 0.998602
'080214 1.002959
'080213 1.00065
'080212 1.003915
'080211 0.998253
'080208 1.000851
'080207 0.988582
'080206 0.997506
'080205 0.995718
Here are the contents of Sheet 2 (one column)
Date
5/2/2008
5/2/2008
5/2/2008
7/2/2008
7/2/2008
7/2/2008
8/2/2008
8/2/2008
8/2/2008
I need to insert second coloumn in Sheet 2 names as Values and populate the numbers in this field from “Value” column in Sheet1 corresponding to the respective dates. For example in Sheet 2, for date 5/2/2008 the value should be 0.995718 (which is against the same date in Sheet 1 i.e 080205)
I just roughly tried the Vlookup function in Excel but it fails to return the value because the date formats are different in both the sheets. If I manually change the dates in both the sheets to the same date format then the vlookup works.
However I actually need a VBA code for Excel to look up for those values in Sheet 2 as I am asked to develop a macro to populate the values in Sheet 2. I am a novice in coding/VBA so can not really understand how to make this work.
Please give some insight on the vba code for excel.
Thanks,
Peace77