Below is the code I use. When I run the series avg_{%h}_bs_{%i} command below it also tries to do this for the second tab (resulting in an error) where it obviously can't find the _bs_ as they are only on the first page.
wfcreate(wf=semi-annual) s 1990 2017
%mypath = @runpath
cd %mypath
'loads first sheet of Excel file where BS data is
pageload(page="Stoxx600_BS") Stoxx600_dataS.xlsx byrow range="EViews1" @freq s 1990s1
pageload(page="Stoxx600_IS") Stoxx600_dataS.xlsx byrow range="EViews2" @freq s 1990s1
'creates average of all variables by dividing totals by number of observations
for %h Cons_Disc Cons_Stap Energy Fin Health Indust IT Mat Telecom Utilities Tot Tot_xFin Tot_xEn Tot_xFE
for %i cash acctrcv invent netfxda totasst LTdebt totliab retearn toteq totlns llrsrv dmddepo STbrrw
series avg_{%h}_bs_{%i} = {%h}_bs_{%i} /{%h}_bs_obs{%i}
next
next
wfcreate(wf=semi-annual) s 1990 2017
%mypath = @runpath
cd %mypath
'loads first sheet of Excel file where BS data is
pageload(page="Stoxx600_BS") Stoxx600_dataS.xlsx byrow range="EViews1" @freq s 1990s1
pageload(page="Stoxx600_IS") Stoxx600_dataS.xlsx byrow range="EViews2" @freq s 1990s1
'creates average of all variables by dividing totals by number of observations
for %h Cons_Disc Cons_Stap Energy Fin Health Indust IT Mat Telecom Utilities Tot Tot_xFin Tot_xEn Tot_xFE
for %i cash acctrcv invent netfxda totasst LTdebt totliab retearn toteq totlns llrsrv dmddepo STbrrw
series avg_{%h}_bs_{%i} = {%h}_bs_{%i} /{%h}_bs_obs{%i}
next
next