I have 6 different workbooks with a minimum of 3 sheets in each of them. I want a VBA code to automatically generate the master workbook with the matching columns from the othes.
Workbook 1 - "Baseline"
hstname Loc Dept User logID HstIP MACAddr OS
abcghj jay aa abc 1 2 1.2.3. 7
sgtsx jay ss sgt 2 3 4.56.8 8
wrgyr jay dd wrg 3 4 5.6.7 8
dfhbnj, jay tt gdxvg 4 8 3.4.5.6.7 7
Workbook 2 - "Daily1"
hstname OnlineStatus result
abcghj scan yes
sgtsx scan yes
wrgyr scan yes
dfhbnj, scan yes
sdrgswdeg scan no
fhawrtu65 scan no
Workbook 2-"Daily2"
hstname OnlineStatus result
abcghj scan yes
sgtsx scan yes
wrgyr scan yes
dfhbnj, scan yes
sdrgswdeg scan no
fhawrtu65 scan yes
24dvg5t scan yes
sedt4et5g scan no
sdgvdsgxsd scan no
And workboook daily3,daily4, daily5 will have same columns as daily1&daily2.
I have filled out the master sheet as an example for you to understand what exactly is my requirement.
NOTE THAT: in my master sheet the columns ID, hstname,user, dept,loc,mac addr is taken from the "baseline" workbook. If the hstname column matches in "baseline" and in "daily1" workbook then copy the "result" column of daily1 workbook to "daily1" column of Master workbook. Repeat the same for daily2,3,4&5. Also note that there should not be any duplicate values (duplicate hstnames in Master).
MASTER sheet
ID hstname daily1 daily2 daily3 d4 d5 User Dept Loc MACAddr
1 abcghj yes yes yes abc aa jay 1.2.3.
2 sgtsx notscan no no sgt ss jay 4.56.8
6 wrgyr yes yes no wrg dd jay 5.6.7
4 dfhbnj, yes notscan no gdxvg tt jay 3.4.5.6.7
8 24dvg5t no yes yes xb ff jay 9.8.56
Any guidance will be greatly appreciated. TIA.
Workbook 1 - "Baseline"
hstname Loc Dept User logID HstIP MACAddr OS
abcghj jay aa abc 1 2 1.2.3. 7
sgtsx jay ss sgt 2 3 4.56.8 8
wrgyr jay dd wrg 3 4 5.6.7 8
dfhbnj, jay tt gdxvg 4 8 3.4.5.6.7 7
Workbook 2 - "Daily1"
hstname OnlineStatus result
abcghj scan yes
sgtsx scan yes
wrgyr scan yes
dfhbnj, scan yes
sdrgswdeg scan no
fhawrtu65 scan no
Workbook 2-"Daily2"
hstname OnlineStatus result
abcghj scan yes
sgtsx scan yes
wrgyr scan yes
dfhbnj, scan yes
sdrgswdeg scan no
fhawrtu65 scan yes
24dvg5t scan yes
sedt4et5g scan no
sdgvdsgxsd scan no
And workboook daily3,daily4, daily5 will have same columns as daily1&daily2.
I have filled out the master sheet as an example for you to understand what exactly is my requirement.
NOTE THAT: in my master sheet the columns ID, hstname,user, dept,loc,mac addr is taken from the "baseline" workbook. If the hstname column matches in "baseline" and in "daily1" workbook then copy the "result" column of daily1 workbook to "daily1" column of Master workbook. Repeat the same for daily2,3,4&5. Also note that there should not be any duplicate values (duplicate hstnames in Master).
MASTER sheet
ID hstname daily1 daily2 daily3 d4 d5 User Dept Loc MACAddr
1 abcghj yes yes yes abc aa jay 1.2.3.
2 sgtsx notscan no no sgt ss jay 4.56.8
6 wrgyr yes yes no wrg dd jay 5.6.7
4 dfhbnj, yes notscan no gdxvg tt jay 3.4.5.6.7
8 24dvg5t no yes yes xb ff jay 9.8.56
Any guidance will be greatly appreciated. TIA.