hi
sorry new to forum and pretty new to VLOOKUP, VBA etc, have played with various things that half do what I want but can't find exact solution
I have two workbooks, one where vehicle hire booking's are stored there is a start date column, end date column and registration column, I then have a separate workbook where I want it to look at first workbook and create a row for each date between the start and end date and copy the registration over so I can enter drivers details and other stuff like have they done a drivers check that day, problem also being that in a season we may have same vehicle registration on hire multiple times the only unique identifier in these cases would be the festival name column.
pls help, I had the registration being returned in second workbook by using ='[2019 critical insurance.xlsx]HGV'!$B20
and start date being returned on one row using =VLOOKUP([@Registration],'[2019 critical insurance.xlsx]HGV'!$B$2:$K$35,6)
but then I am still having to manually do the rows for the other dates, this also then mucked up the registration lookup as I had overwritten the cells that contained $B2 through to $B19 so they were no longer returned, then as soon as I have the same registration twice it removed the first hire completely from the second work book
I then played with using a VBA code to run the dates but end up with similar problems, I also have problems when I try to use VLOOKUP to return the festival name due to registration appearing more than once it ignores the GREE entry and only returns the BOOM entry when using =VLOOKUP([@Registration],'[2019 critical insurance.xlsx]HGV'!$B$2:$M$35,11)
example of first workbook below
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Registration[/TD]
[TD]Hire Start[/TD]
[TD]Hire End[/TD]
[TD]Festival[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]HN16 VNK[/TD]
[TD]2/4/19[/TD]
[TD]5/4/19[/TD]
[TD]GREE[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]HN16 VNK[/TD]
[TD]15/8/19[/TD]
[TD]18/8/19[/TD]
[TD]BOOM[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]R916 YMS[/TD]
[TD]02/5/19[/TD]
[TD]6/5/19[/TD]
[TD]GEN[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
would it help to ID each row entry and in the first workbook and use that somehow, do I need to use INDEX/MATCH with VLOOKUP somehow
example of what I want second workbook to show below, I'm using excel 2016 on windows 10
[TAB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YMS[/TD]
[TD]GEN[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]14[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
sorry new to forum and pretty new to VLOOKUP, VBA etc, have played with various things that half do what I want but can't find exact solution
I have two workbooks, one where vehicle hire booking's are stored there is a start date column, end date column and registration column, I then have a separate workbook where I want it to look at first workbook and create a row for each date between the start and end date and copy the registration over so I can enter drivers details and other stuff like have they done a drivers check that day, problem also being that in a season we may have same vehicle registration on hire multiple times the only unique identifier in these cases would be the festival name column.
pls help, I had the registration being returned in second workbook by using ='[2019 critical insurance.xlsx]HGV'!$B20
and start date being returned on one row using =VLOOKUP([@Registration],'[2019 critical insurance.xlsx]HGV'!$B$2:$K$35,6)
but then I am still having to manually do the rows for the other dates, this also then mucked up the registration lookup as I had overwritten the cells that contained $B2 through to $B19 so they were no longer returned, then as soon as I have the same registration twice it removed the first hire completely from the second work book
I then played with using a VBA code to run the dates but end up with similar problems, I also have problems when I try to use VLOOKUP to return the festival name due to registration appearing more than once it ignores the GREE entry and only returns the BOOM entry when using =VLOOKUP([@Registration],'[2019 critical insurance.xlsx]HGV'!$B$2:$M$35,11)
example of first workbook below
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Registration[/TD]
[TD]Hire Start[/TD]
[TD]Hire End[/TD]
[TD]Festival[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]HN16 VNK[/TD]
[TD]2/4/19[/TD]
[TD]5/4/19[/TD]
[TD]GREE[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]HN16 VNK[/TD]
[TD]15/8/19[/TD]
[TD]18/8/19[/TD]
[TD]BOOM[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]R916 YMS[/TD]
[TD]02/5/19[/TD]
[TD]6/5/19[/TD]
[TD]GEN[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
would it help to ID each row entry and in the first workbook and use that somehow, do I need to use INDEX/MATCH with VLOOKUP somehow
example of what I want second workbook to show below, I'm using excel 2016 on windows 10
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Date[/TD]
[TD]Registration[/TD]
[TD]Festival[/TD]
[TD]Driver Name[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]2/4/19[/TD]
[TD]HN16 VNK[/TD]
[TD]GREE[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]3/4/19[/TD]
[TD]HN16 VNK[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]4/4/19[/TD]
[TD]HN16 VNK[/TD]
[TD]GREE[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]5/4/19[/TD]
[TD]HN16 VNK[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]15/8/19[/TD]
[TD]HN16 VNK[/TD]
[TD]BOOM[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]16/8/19[/TD]
[TD]HN16 VNK[/TD]
[TD]BOOM[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]17/8/19[/TD]
[TD]HN16 VNK[/TD]
[TD]BOOM[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]18/8/19[/TD]
[TD]HN16 VNK[/TD]
[TD]BOOM[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]2/5/19[/TD]
[TD]R916 YMS[/TD]
[TD]GEN[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10[/TD]
[TD]3/5/19[/TD]
[TD]R916 YMS[/TD]
[TD]GEN[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]11[/TD]
[TD]4/5/19[/TD]
[TD]R916 YMS[/TD]
[TD]GEN[/TD]
[TD][/TD]
[/TR]
[TR]
[TD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