ashwinashes
New Member
- Joined
- Nov 12, 2019
- Messages
- 1
I have two excel files, one is file named data and other one is flile named format. The data file has multiple sheet named as "north" ,"south" and "west", each of these sheets have a reference column containing values a, b,c,d,e as values of first column and dates from Nov 4 to Nov 10 as values of first row. And corresponding to these dates and reference column, there are numerical values in the cells. Similarly, in the file named format, the first column has these values which are the sheet names of data files, like north south west, second column is the reference values from first column of data file, a, b, c, d, e, and the first row has dates, as same as in the other file, now I need to get the values from data file to format file, based on this sheet name, reference column and date, something like a lookup but a complicated. Pls help me out. i need the vba script for doing this
data file : (considering the sheet name is north)
[TABLE="width: 500"]
<tbody>[TR]
[TD]reference[/TD]
[TD][TABLE="width: 74"]
<tbody>[TR]
[TD="class: xl66, width: 74, align: right"]2019-11-04[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 74"]
<tbody>[TR]
[TD="class: xl66, width: 74, align: right"]2019-11-05[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 74"]
<tbody>[TR]
[TD="class: xl66, width: 74, align: right"]2019-11-06[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]a[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]b[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]c[/TD]
[TD]7[/TD]
[TD]8[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]d[/TD]
[TD]10[/TD]
[TD]11[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]e[/TD]
[TD]13[/TD]
[TD]14[/TD]
[TD]15[/TD]
[/TR]
</tbody>[/TABLE]
format file :
[TABLE="width: 500"]
<tbody>[TR]
[TD]sheet[/TD]
[TD]reference[/TD]
[TD][TABLE="width: 74"]
<tbody>[TR]
[TD="class: xl66, width: 74, align: right"]2019-11-04[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 74"]
<tbody>[TR]
[TD="class: xl66, width: 74, align: right"]2019-11-05[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 74"]
<tbody>[TR]
[TD="class: xl66, width: 74, align: right"]2019-11-06[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]west[/TD]
[TD]b[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]west[/TD]
[TD]c[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]north[/TD]
[TD]b[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]north[/TD]
[TD]c[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]south[/TD]
[TD]b[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]south[/TD]
[TD]c[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
expected output:[TABLE="width: 500"]
<tbody>[TR]
[TD]sheet[/TD]
[TD]reference[/TD]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl63, width: 75"]2019-11-04[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl65, width: 75"]2019-11-05[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl65, width: 75"]2019-11-06[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]west[/TD]
[TD]b[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]west[/TD]
[TD]c[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]north[/TD]
[TD]b[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]north[/TD]
[TD]c[/TD]
[TD]7[/TD]
[TD]8[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]south[/TD]
[TD]b[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]south[/TD]
[TD]c[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
data file : (considering the sheet name is north)
[TABLE="width: 500"]
<tbody>[TR]
[TD]reference[/TD]
[TD][TABLE="width: 74"]
<tbody>[TR]
[TD="class: xl66, width: 74, align: right"]2019-11-04[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 74"]
<tbody>[TR]
[TD="class: xl66, width: 74, align: right"]2019-11-05[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 74"]
<tbody>[TR]
[TD="class: xl66, width: 74, align: right"]2019-11-06[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]a[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]b[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]c[/TD]
[TD]7[/TD]
[TD]8[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]d[/TD]
[TD]10[/TD]
[TD]11[/TD]
[TD]12[/TD]
[/TR]
[TR]
[TD]e[/TD]
[TD]13[/TD]
[TD]14[/TD]
[TD]15[/TD]
[/TR]
</tbody>[/TABLE]
format file :
[TABLE="width: 500"]
<tbody>[TR]
[TD]sheet[/TD]
[TD]reference[/TD]
[TD][TABLE="width: 74"]
<tbody>[TR]
[TD="class: xl66, width: 74, align: right"]2019-11-04[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 74"]
<tbody>[TR]
[TD="class: xl66, width: 74, align: right"]2019-11-05[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 74"]
<tbody>[TR]
[TD="class: xl66, width: 74, align: right"]2019-11-06[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]west[/TD]
[TD]b[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]west[/TD]
[TD]c[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]north[/TD]
[TD]b[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]north[/TD]
[TD]c[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]south[/TD]
[TD]b[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]south[/TD]
[TD]c[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
expected output:[TABLE="width: 500"]
<tbody>[TR]
[TD]sheet[/TD]
[TD]reference[/TD]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl63, width: 75"]2019-11-04[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl65, width: 75"]2019-11-05[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl65, width: 75"]2019-11-06[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]west[/TD]
[TD]b[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]west[/TD]
[TD]c[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]north[/TD]
[TD]b[/TD]
[TD]4[/TD]
[TD]5[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]north[/TD]
[TD]c[/TD]
[TD]7[/TD]
[TD]8[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]south[/TD]
[TD]b[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]south[/TD]
[TD]c[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]