kalpesh505ahd
New Member
- Joined
- Sep 6, 2015
- Messages
- 2
Dear All,
I am new to excel VBA and need to find solution for the issue I am struggling with. In one file, there are 5 input spreadsheet and one output spreadsheet.
(1) RAVE - input spreadsheet
[TABLE="width: 259"]
<tbody>[TR]
[TD]Subject
[/TD]
[TD]Visit
[/TD]
[TD]Date
[/TD]
[TD]Date
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 0
[/TD]
[TD]01-Jan-15
[/TD]
[TD]01-Jan-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 4
[/TD]
[TD]01-Feb-15
[/TD]
[TD]01-Feb-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 8
[/TD]
[TD]01-Mar-15
[/TD]
[TD]01-Mar-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 0
[/TD]
[TD]01-Apr-15
[/TD]
[TD]01-Apr-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 4
[/TD]
[TD]01-May-15
[/TD]
[TD]01-May-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 8
[/TD]
[TD]01-Jun-16
[/TD]
[TD]01-Jun-16
[/TD]
[/TR]
</tbody>[/TABLE]
(2) LB - input spreadsheet
[TABLE="width: 261"]
<tbody>[TR]
[TD]Subject
[/TD]
[TD]Visit
[/TD]
[TD]Date
[/TD]
[TD]Date
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 0
[/TD]
[TD]01-Jan-15
[/TD]
[TD]01-Jan-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 4
[/TD]
[TD]01-Feb-15
[/TD]
[TD]01-Feb-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 8
[/TD]
[TD]01-Mar-15
[/TD]
[TD]01-Mar-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 0
[/TD]
[TD]01-Jan-15
[/TD]
[TD]01-Jan-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 4
[/TD]
[TD]01-Feb-15
[/TD]
[TD]01-Feb-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 8
[/TD]
[TD]01-Mar-15
[/TD]
[TD]01-Mar-15
[/TD]
[/TR]
</tbody>[/TABLE]
(3) ST - Input spreadsheet
[TABLE="width: 269"]
<tbody>[TR]
[TD]Subject
[/TD]
[TD]Visit
[/TD]
[TD]Date
[/TD]
[TD]Date
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 0
[/TD]
[TD]01-Apr-15
[/TD]
[TD]01-Apr-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 4
[/TD]
[TD]01-May-15
[/TD]
[TD]01-May-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 8
[/TD]
[TD]01-Jun-16
[/TD]
[TD]01-Jun-16
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 0
[/TD]
[TD]01-Jan-15
[/TD]
[TD]01-Jan-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 4
[/TD]
[TD]01-Feb-15
[/TD]
[TD]01-Feb-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 8
[/TD]
[TD]01-Mar-15
[/TD]
[TD]01-Mar-15
[/TD]
[/TR]
</tbody>[/TABLE]
(4) ZR - input spreadsheet
[TABLE="width: 269"]
<tbody>[TR]
[TD]Subject
[/TD]
[TD]Visit
[/TD]
[TD]Date
[/TD]
[TD]Date
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 8
[/TD]
[TD]01-Apr-15
[/TD]
[TD]01-Apr-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 4
[/TD]
[TD]01-May-15
[/TD]
[TD]01-May-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 0
[/TD]
[TD]01-Jun-16
[/TD]
[TD]01-Jun-16
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 0
[/TD]
[TD]01-Jan-15
[/TD]
[TD]01-Jan-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 4
[/TD]
[TD]01-Feb-15
[/TD]
[TD]01-Feb-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 8
[/TD]
[TD]01-Mar-15
[/TD]
[TD]01-Mar-15
[/TD]
[/TR]
</tbody>[/TABLE]
(5) EG - input spreadsheet
[TABLE="width: 269"]
<tbody>[TR]
[TD]Subject
[/TD]
[TD]Visit
[/TD]
[TD]Date
[/TD]
[TD]Date
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 0
[/TD]
[TD]01-Apr-15
[/TD]
[TD]01-Apr-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 4
[/TD]
[TD]01-May-15
[/TD]
[TD]01-May-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 8
[/TD]
[TD]01-Jun-16
[/TD]
[TD]01-Jun-16
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 8
[/TD]
[TD]01-Jan-15
[/TD]
[TD]01-Jan-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 4
[/TD]
[TD]01-Feb-15
[/TD]
[TD]01-Feb-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 0
[/TD]
[TD]01-Mar-15
[/TD]
[TD]01-Mar-15
[/TD]
[/TR]
</tbody>[/TABLE]
(6) ePRO -Input spreadsheet
[TABLE="width: 259"]
<tbody>[TR]
[TD]Subject
[/TD]
[TD]Visit
[/TD]
[TD]Date
[/TD]
[TD]Date
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 0
[/TD]
[TD]01-Apr-15
[/TD]
[TD]01-Apr-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 4
[/TD]
[TD]01-May-15
[/TD]
[TD]01-May-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 8
[/TD]
[TD]01-Jun-16
[/TD]
[TD]01-Jun-16
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 8
[/TD]
[TD]01-Jan-15
[/TD]
[TD]01-Jan-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 4
[/TD]
[TD]01-Feb-15
[/TD]
[TD]01-Feb-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 0
[/TD]
[TD]01-Mar-15
[/TD]
[TD]01-Mar-15
[/TD]
[/TR]
</tbody>[/TABLE]
(7) Output - spreadsheet
[TABLE="width: 835"]
<tbody>[TR]
[TD]Subject
[/TD]
[TD]Visit
[/TD]
[TD]RAVE
[/TD]
[TD]LB
[/TD]
[TD]ST
[/TD]
[TD]ZR
[/TD]
[TD]EG
[/TD]
[TD]ePRO
[/TD]
[TD]Mismatch against RAVE date
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 0
[/TD]
[TD]01-Jan-2015
[/TD]
[TD]01-Jan-2015
[/TD]
[TD]01-Apr-2015
[/TD]
[TD]01-Jun-2016
[/TD]
[TD]01-Apr-2015
[/TD]
[TD]01-Apr-2015
[/TD]
[TD]LB, ZR, EG, ePRO
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 4
[/TD]
[TD]01-Feb-2015
[/TD]
[TD]01-Feb-2015
[/TD]
[TD]01-May-2015
[/TD]
[TD]01-May-2015
[/TD]
[TD]01-May-2015
[/TD]
[TD]01-May-2015
[/TD]
[TD]ST, ZR, EG, ePRO
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 8
[/TD]
[TD]01-Mar-2015
[/TD]
[TD]01-Mar-2015
[/TD]
[TD]01-Jun-2016
[/TD]
[TD]01-Apr-2015
[/TD]
[TD]01-Jun-2016
[/TD]
[TD]01-Jun-2016
[/TD]
[TD]ST, ZR, EG, ePRO
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 0
[/TD]
[TD]01-Apr-2015
[/TD]
[TD]01-Jan-2015
[/TD]
[TD]01-Jan-2015
[/TD]
[TD]01-Jan-2015
[/TD]
[TD]01-Mar-2015
[/TD]
[TD]01-Mar-2015
[/TD]
[TD]LB, ST, ZR, EG, ePRO
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 4
[/TD]
[TD]01-May-2015
[/TD]
[TD]01-Feb-2015
[/TD]
[TD]01-Feb-2015
[/TD]
[TD]01-Feb-2015
[/TD]
[TD]01-Feb-2015
[/TD]
[TD]01-Feb-2015
[/TD]
[TD]LB, ST, ZR, EG, ePRO
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 8
[/TD]
[TD]01-Jun-2016
[/TD]
[TD]01-Mar-2015
[/TD]
[TD]01-Mar-2015
[/TD]
[TD]01-Mar-2015
[/TD]
[TD]01-Jan-2015
[/TD]
[TD]01-Jan-2015
[/TD]
[TD]LB, ST, ZR, EG, ePRO
[/TD]
[/TR]
</tbody>[/TABLE]
I am using excel formula concatenate (Subject&Visit) and VLOOKUP to get the date from Input spreadsheet to Output spreadsheet. however data in Output - Mismatch against RAVE data is added manually.
I need help creating macro which can generate the output spreadsheet automatically. Is it possible?
Regards,
Kalpesh
I am new to excel VBA and need to find solution for the issue I am struggling with. In one file, there are 5 input spreadsheet and one output spreadsheet.
(1) RAVE - input spreadsheet
[TABLE="width: 259"]
<tbody>[TR]
[TD]Subject
[/TD]
[TD]Visit
[/TD]
[TD]Date
[/TD]
[TD]Date
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 0
[/TD]
[TD]01-Jan-15
[/TD]
[TD]01-Jan-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 4
[/TD]
[TD]01-Feb-15
[/TD]
[TD]01-Feb-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 8
[/TD]
[TD]01-Mar-15
[/TD]
[TD]01-Mar-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 0
[/TD]
[TD]01-Apr-15
[/TD]
[TD]01-Apr-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 4
[/TD]
[TD]01-May-15
[/TD]
[TD]01-May-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 8
[/TD]
[TD]01-Jun-16
[/TD]
[TD]01-Jun-16
[/TD]
[/TR]
</tbody>[/TABLE]
(2) LB - input spreadsheet
[TABLE="width: 261"]
<tbody>[TR]
[TD]Subject
[/TD]
[TD]Visit
[/TD]
[TD]Date
[/TD]
[TD]Date
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 0
[/TD]
[TD]01-Jan-15
[/TD]
[TD]01-Jan-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 4
[/TD]
[TD]01-Feb-15
[/TD]
[TD]01-Feb-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 8
[/TD]
[TD]01-Mar-15
[/TD]
[TD]01-Mar-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 0
[/TD]
[TD]01-Jan-15
[/TD]
[TD]01-Jan-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 4
[/TD]
[TD]01-Feb-15
[/TD]
[TD]01-Feb-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 8
[/TD]
[TD]01-Mar-15
[/TD]
[TD]01-Mar-15
[/TD]
[/TR]
</tbody>[/TABLE]
(3) ST - Input spreadsheet
[TABLE="width: 269"]
<tbody>[TR]
[TD]Subject
[/TD]
[TD]Visit
[/TD]
[TD]Date
[/TD]
[TD]Date
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 0
[/TD]
[TD]01-Apr-15
[/TD]
[TD]01-Apr-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 4
[/TD]
[TD]01-May-15
[/TD]
[TD]01-May-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 8
[/TD]
[TD]01-Jun-16
[/TD]
[TD]01-Jun-16
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 0
[/TD]
[TD]01-Jan-15
[/TD]
[TD]01-Jan-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 4
[/TD]
[TD]01-Feb-15
[/TD]
[TD]01-Feb-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 8
[/TD]
[TD]01-Mar-15
[/TD]
[TD]01-Mar-15
[/TD]
[/TR]
</tbody>[/TABLE]
(4) ZR - input spreadsheet
[TABLE="width: 269"]
<tbody>[TR]
[TD]Subject
[/TD]
[TD]Visit
[/TD]
[TD]Date
[/TD]
[TD]Date
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 8
[/TD]
[TD]01-Apr-15
[/TD]
[TD]01-Apr-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 4
[/TD]
[TD]01-May-15
[/TD]
[TD]01-May-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 0
[/TD]
[TD]01-Jun-16
[/TD]
[TD]01-Jun-16
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 0
[/TD]
[TD]01-Jan-15
[/TD]
[TD]01-Jan-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 4
[/TD]
[TD]01-Feb-15
[/TD]
[TD]01-Feb-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 8
[/TD]
[TD]01-Mar-15
[/TD]
[TD]01-Mar-15
[/TD]
[/TR]
</tbody>[/TABLE]
(5) EG - input spreadsheet
[TABLE="width: 269"]
<tbody>[TR]
[TD]Subject
[/TD]
[TD]Visit
[/TD]
[TD]Date
[/TD]
[TD]Date
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 0
[/TD]
[TD]01-Apr-15
[/TD]
[TD]01-Apr-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 4
[/TD]
[TD]01-May-15
[/TD]
[TD]01-May-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 8
[/TD]
[TD]01-Jun-16
[/TD]
[TD]01-Jun-16
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 8
[/TD]
[TD]01-Jan-15
[/TD]
[TD]01-Jan-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 4
[/TD]
[TD]01-Feb-15
[/TD]
[TD]01-Feb-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 0
[/TD]
[TD]01-Mar-15
[/TD]
[TD]01-Mar-15
[/TD]
[/TR]
</tbody>[/TABLE]
(6) ePRO -Input spreadsheet
[TABLE="width: 259"]
<tbody>[TR]
[TD]Subject
[/TD]
[TD]Visit
[/TD]
[TD]Date
[/TD]
[TD]Date
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 0
[/TD]
[TD]01-Apr-15
[/TD]
[TD]01-Apr-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 4
[/TD]
[TD]01-May-15
[/TD]
[TD]01-May-15
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 8
[/TD]
[TD]01-Jun-16
[/TD]
[TD]01-Jun-16
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 8
[/TD]
[TD]01-Jan-15
[/TD]
[TD]01-Jan-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 4
[/TD]
[TD]01-Feb-15
[/TD]
[TD]01-Feb-15
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 0
[/TD]
[TD]01-Mar-15
[/TD]
[TD]01-Mar-15
[/TD]
[/TR]
</tbody>[/TABLE]
(7) Output - spreadsheet
[TABLE="width: 835"]
<tbody>[TR]
[TD]Subject
[/TD]
[TD]Visit
[/TD]
[TD]RAVE
[/TD]
[TD]LB
[/TD]
[TD]ST
[/TD]
[TD]ZR
[/TD]
[TD]EG
[/TD]
[TD]ePRO
[/TD]
[TD]Mismatch against RAVE date
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 0
[/TD]
[TD]01-Jan-2015
[/TD]
[TD]01-Jan-2015
[/TD]
[TD]01-Apr-2015
[/TD]
[TD]01-Jun-2016
[/TD]
[TD]01-Apr-2015
[/TD]
[TD]01-Apr-2015
[/TD]
[TD]LB, ZR, EG, ePRO
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 4
[/TD]
[TD]01-Feb-2015
[/TD]
[TD]01-Feb-2015
[/TD]
[TD]01-May-2015
[/TD]
[TD]01-May-2015
[/TD]
[TD]01-May-2015
[/TD]
[TD]01-May-2015
[/TD]
[TD]ST, ZR, EG, ePRO
[/TD]
[/TR]
[TR]
[TD]30001
[/TD]
[TD]Week 8
[/TD]
[TD]01-Mar-2015
[/TD]
[TD]01-Mar-2015
[/TD]
[TD]01-Jun-2016
[/TD]
[TD]01-Apr-2015
[/TD]
[TD]01-Jun-2016
[/TD]
[TD]01-Jun-2016
[/TD]
[TD]ST, ZR, EG, ePRO
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 0
[/TD]
[TD]01-Apr-2015
[/TD]
[TD]01-Jan-2015
[/TD]
[TD]01-Jan-2015
[/TD]
[TD]01-Jan-2015
[/TD]
[TD]01-Mar-2015
[/TD]
[TD]01-Mar-2015
[/TD]
[TD]LB, ST, ZR, EG, ePRO
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 4
[/TD]
[TD]01-May-2015
[/TD]
[TD]01-Feb-2015
[/TD]
[TD]01-Feb-2015
[/TD]
[TD]01-Feb-2015
[/TD]
[TD]01-Feb-2015
[/TD]
[TD]01-Feb-2015
[/TD]
[TD]LB, ST, ZR, EG, ePRO
[/TD]
[/TR]
[TR]
[TD]30002
[/TD]
[TD]Week 8
[/TD]
[TD]01-Jun-2016
[/TD]
[TD]01-Mar-2015
[/TD]
[TD]01-Mar-2015
[/TD]
[TD]01-Mar-2015
[/TD]
[TD]01-Jan-2015
[/TD]
[TD]01-Jan-2015
[/TD]
[TD]LB, ST, ZR, EG, ePRO
[/TD]
[/TR]
</tbody>[/TABLE]
I am using excel formula concatenate (Subject&Visit) and VLOOKUP to get the date from Input spreadsheet to Output spreadsheet. however data in Output - Mismatch against RAVE data is added manually.
I need help creating macro which can generate the output spreadsheet automatically. Is it possible?
Regards,
Kalpesh