Home

I did it, guess so. The External Referencing.

%3CLINGO-SUB%20id%3D%22lingo-sub-868706%22%20slang%3D%22en-US%22%3ERe%3A%20External%20referencing%20help%20needed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-868706%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F412472%22%20target%3D%22_blank%22%3E%40dummy810%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHey%20guys%2C%3C%2FP%3E%3CP%3EAfter%20abit%20refreshment%20over%20last%20night%20I%20think%20my%20mind%20has%20come%20a%20bit%20clearer.%3C%2FP%3E%3CP%3EI%20think%20I've%20solved%20the%20problem%20by%2050%25%20-%20I've%20made%20the%20formula%20work%2C%20it%20does%20what%20I%20was%20looking%20for%2C%20so%20I'll%20leave%20it%20here%20in%20case%20someone%20needs%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DINDIRECT(%22%5Bbook2.xlsx%5D%22%26amp%3B(MID(CELL(%22filename%22%2CA1)%2CFIND(%22%5D%22%2CCELL(%22filename%22%2CA1))%2B1%2C255))%26amp%3B%22!A1%22)%3C%2FP%3E%3CP%3EThis%20code%20works%20like%20this%3A%20It%20returns%20you%20the%20value%20of%20cell%20A1%20lying%20in%20book2%2C%20under%20the%20same%20worksheet%20tag%20where%20the%20formula%20is%20in%20book1.%3C%2FP%3E%3CP%3ESo%2C%20you%20put%20it%20in%20book1%2C%20sheetX%2C%20A1%2C%20you%20get%20what's%20in%20book2%2C%20sheetX%2C%20A1.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20then%20here%20another%20problem%2C%20it%20is%20a%20dynamic%20link%2C%20so%20if%20you%20close%20book2%2C%20in%20book1%20you%20lose%20the%20value%20of%20that%20A1%20of%20book2.%20It%20is%20abit%20annoying%20since%20I%20though%20it%20works%20like%20a%20link%20so%20I%20can%20save%20the%20data%20by%20breaking%20it%20at%20any%20time.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDoes%20anyone%20know%20formulas%20that%20can%20create%20a%20link%20with%20external%20sources%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECheers%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-868772%22%20slang%3D%22en-US%22%3ERe%3A%20External%20referencing%20help%20still%20needed%20(partly%20solved%3Fmaybe)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-868772%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F412472%22%20target%3D%22_blank%22%3E%40dummy810%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3EI%20guess%20this%20formula%20returns%20current%20sheet%20name.%20Yes%2C%20sure%2C%20you%20may%20use%20it%20instead%20of%20%3CCURRENT%20sheet%3D%22%22%3E.%20But%20again%2C%20it's%20much%20better%20not%20to%20complicate%20the%20formula%20but%20use%20helper%20cell.%20Take%20it%20in%20the%20place%20where%20end-user%20can't%20see%2C%20in%20addition%20you%20may%20hide%20column%2Frow%20with%20it%2C%20add%20your%20formula%20into%20this%20cell%20and%20in%20formula%20with%20links%20use%20reference%20on%20this%20helper%20cell.%3C%2FCURRENT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-868710%22%20slang%3D%22en-US%22%3ERe%3A%20External%20referencing%20help%20still%20needed%20(partly%20solved%3Fmaybe)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-868710%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F412472%22%20target%3D%22_blank%22%3E%40dummy810%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYes%2C%20INDIRECT%20doesn't%20work%20with%20closed%20files.%20The%20workaround%20could%20be%2C%20if%20without%20VBA%2C%20formula%20like%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%3D%0AIF(%3CCURRENT%20sheet%3D%22%22%3E%3D%22Sheet1%22%2C%20%5BBook2.xlsx%5DSheet1!A1%2C%0AIF(%3CCURRENT%20sheet%3D%22%22%3E%3D%22Sheet2%22%2C%20%5BBook2.xlsx%5DSheet2!A1%2C%0AIF(%3CCURRENT%20sheet%3D%22%22%3E%3D%22Sheet3%22%2C%20%5BBook2.xlsx%5DSheet3!A1%2C%0AIF(%3CCURRENT%20sheet%3D%22%22%3E%3D%22Sheet4%22%2C%20%5BBook2.xlsx%5DSheet4!A1%2C%0AIF(%3CCURRENT%20sheet%3D%22%22%3E%3D%22Sheet5%22%2C%20%5BBook2.xlsx%5DSheet5!A1%0A)))))%3C%2FCURRENT%3E%3C%2FCURRENT%3E%3C%2FCURRENT%3E%3C%2FCURRENT%3E%3C%2FCURRENT%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Ewhere%20%3CCURRENT%20sheet%3D%22%22%3E%20you%20may%20pick-up%20from%20CELL()%20formula.%20Even%20better%20is%20to%20keep%20helper%20cells%20for%20each%20sheet%20with%20current%20sheet%20name%20and%20use%20reference%20on%20it.%20Not%20very%20elegant%20but%20it%20could%20work%20if%20you%20don't%20have%20a%20hundreds%20of%20worksheets%20and%20don't%20add%2Fremove%20sheets%2C%20at%20least%20frequently.%3C%2FCURRENT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-869198%22%20slang%3D%22en-US%22%3ERe%3A%20External%20referencing%20help%20still%20needed%20(partly%20solved%3Fmaybe)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-869198%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%3C%2FP%3E%3CP%3EHi%20Sergei%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20tried%20your%20formula%20it%20works%20well.%3C%2FP%3E%3CP%3EBut%20yeah%20it%20is%20a%20bit%20bulky%2C%20haha%2C%20sorry%20to%20say%20that%2C%20I%20mean%2C%20because%20we%20have%20too%20many%20tags%20here%20%26amp%3B%20the%20number%20is%20still%20growing%20so%20it%20would%20be%20a%20pain%20to%20use%20that.%3C%2FP%3E%3CPRE%3EIF(%26lt%3Bcurrent%20sheet%26gt%3B%3D%22Sheet5%22%2C%20%5BBook2.xlsx%5DSheet5!A1%0A)%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20believe%20if%20I%20can%20replace%20that%20%22Sheet5%22%20following%20%5BBook2.xlsx%5D%20with%20cell()%2C%20i.e.%20%5Bbook2%5DCell()%20in%20which%20cell()%20to%20pick%20up%20the%20tag%20name%2C%20then%20it%20will%20help%20me%20get%20what%20I%20want%20in%20book2%20under%20same%20tag%2C%20and%20there's%20no%20need%20to%20change%20the%20formula%20manually.%3C%2FP%3E%3CP%3EBut%20in%20fact%20it%20is%20an%20external%20link%2C%20so%20I'm%20not%20sure%20if%20we%20make%20it%20like%20that.%3C%2FP%3E%3CP%3ESo%20far%20I've%20tried%20to%20put%20cell()%20and%20%5Bbook2%5D%20together%20over%20and%20over%20and%20over%20-%20a%20big%20fail.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20do%20you%20think%3F%20Is%20that%20because%20that%20I%20use%20connectors%20in%20a%20wrong%20way%2C%20like%20misplaced%20%26amp%3B%20'%20%22%20so%20excel%20can't%20read%20it%2C%20if%20so%20can%20you%20please%20give%20me%20some%20ideas.%20Or%20we%20just%20cannot%20embed%20cell()%20in%20an%20external%20link%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20your%20time.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-868733%22%20slang%3D%22en-US%22%3ERe%3A%20External%20referencing%20help%20still%20needed%20(partly%20solved%3Fmaybe)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-868733%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%20Sergei%20thanks%20for%20your%20reply%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYour%20suggestion%20is%20awesome%2C%20and%20yeah%20the%20truth%20is%20that%20we%20do%20change%20our%20tags%20very....%20often%2C%20that's%20why%20I%20want%20to%20embed%20a%20formula%20to%20help%20tag%20names%20update%20themselves%20automatically.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20your%20knowledge%2C%20is%20that%20possible%20to%20apply%20this%20formula%20(MID(CELL(%22filename%22%2CA1)%2CFIND(%22%5D%22%2CCELL(%22filename%22%2CA1))%2B1%2C255))%3C%2FP%3E%3CP%3Ein%20yours%2C%20so%20we%20don't%20have%20to%20update%20worksheet%20names%20manually.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-869206%22%20slang%3D%22en-US%22%3ERe%3A%20External%20referencing%20help%20still%20needed%20(partly%20solved%3Fmaybe)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-869206%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F412472%22%20target%3D%22_blank%22%3E%40dummy810%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20may%20combine%20them%20with%20INDIRECT%20and%20that%20returns%20you%20back%20to%20initial%20problem.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-869207%22%20slang%3D%22en-US%22%3ERe%3A%20External%20referencing%20help%20still%20needed%20(partly%20solved%3Fmaybe)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-869207%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F412472%22%20target%3D%22_blank%22%3E%40dummy810%3C%2FA%3E%26nbsp%3B%20Bulky%20!%20That's%26nbsp%3B%20the%20word%20you%20use%20!%20I%20have%20been%20wondering%20about%20this%20whole%20situation%20and%20I%20am%20please%20with%20your%20mans%20advice%20He%20will%20help%20you%20!%20But%20Bulky%20!%20THAT%20IS%20AN%20UNDERSTATEMENT%20!%20Good%20luck%20in%20your%20endeavors%20!%20Richarrut%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-869212%22%20slang%3D%22en-US%22%3ERe%3A%20External%20referencing%20help%20still%20needed%20(partly%20solved%3Fmaybe)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-869212%22%20slang%3D%22en-US%22%3EYeah%20you're%20right.%20So%20I%20might%2C%20try%20something%20else%20I%20guess.%20Cheers%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-869213%22%20slang%3D%22en-US%22%3ERe%3A%20External%20referencing%20help%20still%20needed%20(partly%20solved%3Fmaybe)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-869213%22%20slang%3D%22en-US%22%3EHaha%2C%20I'm%20losing%20faith%20in%20myself%20but%20I%20will%20try%20a%20bit%20more.%20Touch%20wood%2C%20touch%20wood.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-869215%22%20slang%3D%22en-US%22%3ERe%3A%20External%20referencing%20help%20still%20needed%20(partly%20solved%3Fmaybe)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-869215%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F412472%22%20target%3D%22_blank%22%3E%40dummy810%3C%2FA%3E%26nbsp%3B%20I%20love%20your%20comment%20your%20losing%20faith%20in%20your%20ability%20!%20Ha%20Ha%20you%20will%20keep%20trying%20!%20Touch%20Wood%20Touch%20Wood%20!%20Not%20one%20person%20speaks%20like%20that%20here%20!%20Hey%20Guy%20Machines%20are%20doing%20us%20in%20each%20day%20!%20and%20we%20get%20paid%20to%20help%20the%20darn%20things%20!%20You%20are%20fine%20and%20you%20will%20do%20fine%20!%20JUST%20BREATH%20!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-869269%22%20slang%3D%22en-US%22%3ERe%3A%20External%20referencing%20help%20still%20needed%20(partly%20solved%3Fmaybe)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-869269%22%20slang%3D%22en-US%22%3EHA%20Thanks%20for%20pump%20me%20mate.%20At%20last%20I%20made%20it%2C%20the%20solution%20is%20not%20straightforward%2C%20kinda%20stupid.%20But%2C%20it%20works.%20So%20we'll%20see%20how%20it%20goes.%20Hope%20it'll%20do%20the%20job.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-867337%22%20slang%3D%22en-US%22%3EI%20did%20it%2C%20guess%20so.%20The%20External%20Referencing.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-867337%22%20slang%3D%22en-US%22%3E%3CP%3EHey%20guys%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20your%20replies.%3C%2FP%3E%3CP%3EAnd%20eventually%20I%20made%20it%20work%2C%20in%20a%20very%20amateur%20%26amp%3B%20dumb%20manner.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20our%20problem%20is%20that%20we%20manage%20our%20accounts%20every%20day%2C%20here%20we%20have%20today's%20book%20and%20the%20one%20from%20yesterday.%3C%2FP%3E%3CP%3EAnd%20there%20are%20so%20many%20tags%2C%20we%20need%20to%20copy%20%26amp%3B%20paste%20the%20balance%20sitting%20in%20A2%20from%20tag%20X%2C%20Book%20Yesterday%20to%20A2%20under%20tag%20X%20Book%20Today.%20It's%20annoying%20and%20we%20made%20mistakes%20from%20time%20to%20time.%20So%20we%20decided%20to%20do%20something.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1)%20Our%20first%20solution%20is%20to%20link%20A2%20Book%20Today%20to%20A2%20Book%20Yesterday%2C%20after%20updating%20it%20we%20break%20the%20link%20then%20yesterday's%20balance%20is%20remained%20in%20Book%20Today.%20Pretty%20good.%3C%2FP%3E%3CP%3EBut%2C%20we%20have%20too%20many%20tags%20-%20cell()%20can%20trace%20the%20tag%20name%20but%20it%20seems%20that%20you%20can't%20embed%20that%20in%20a%20link%2C%20which%20means%20we%20need%20to%20link%20them%20one%20by%20one%2C%20and%20update%20them%20when%20a%20tag%20name%20changes.%3C%2FP%3E%3CP%3ECrap.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2)%20Then%20I%20found%20indirect()%2C%20which%20can%20work%20together%20with%20cell()%2C%20meaning%20that%20we%20don't%20have%20to%20key%20in%20tag%20names%20separately.%20Cool.%3C%2FP%3E%3CP%3EThe%20bad%20news%20is%2C%20indirect()%20creates%20a%20dynamic%20link%20-%20you%20close%20Book%20Yesterday%2C%20you%20lose%20its%20value%20in%20Book%20Today.%20Yes%2C%20there's%20a%20solution%20-%20just%20copy%20%26amp%3B%20paste%20the%20value%20to%20A2.%20But%20still%2C%20you%20have%20to%20repeat%20the%20step%20for%20each%20single%20worksheet.%3C%2FP%3E%3CP%3EScrap%20that!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E3)%20Eventually%20I%20turned%20to%20macro.%20Hmm%2C%20don't%20know%20where%20to%20start%2C%20there%20should%20be%20some%20key%20words%20or%20technical%20terms%20but%20obviously%20I%20have%20no%20idea.%20So%20I%20was%20just%2C%20looking%20for%20something%20relevant%2C%20blindly.%20And%20soon%20I%20found%20something%20like%20loop%20through%20worksheets.%20And%20there%20you%20go%2C%20it%20solved%20my%20problem.%3C%2FP%3E%3CP%3EIndirect()%20can%20read%20the%20value%20but%20can't%20save%20the%20value.%20Instead%20of%20manually%20copy%26amp%3Bpaste%20the%20balance%20in%20each%20worksheet%2C%20I%20tried%20macro%20and%20it%20works.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EHere%20the%20solution.%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3EA1%3DBalance%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3EA2%3DINDIRECT(%22%5Bbook2.xlsx%5D%22%26amp%3B(MID(CELL(%22filename%22%2CA2)%2CFIND(%22%5D%22%2CCELL(%22filename%22%2CA2))%2B1%2C255))%26amp%3B%22!A2%22)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3EFollowed%20by%20the%20Macro%20%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Sub%20WorksheetLoop()%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSTRONG%3EDim%20ws%20As%20Worksheet%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20For%20Each%20ws%20In%20Worksheets%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%20%3CSTRONG%3EIf%20ws.Range(%22A1%22)%20%3D%20%22Balance%22%20Then%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%20ws.Range(%22A2%22).Copy%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20ws.Range(%22A2%22).PasteSpecial%20Paste%3A%3DxlPasteValues%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CSTRONG%3EApplication.CutCopyMode%20%3D%20False%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20End%20If%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Next%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CSTRONG%3E%26nbsp%3B%20End%20Sub%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3EHit%20the%20button%20%26amp%3B%20all%20dynamic%20values%20in%20A2s%20are%20replaced%20by%20fixed%20figures.%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3ESorted!%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EApparently%20it's%20not%20the%20best%20but%20it%20works%2C%20and%20this%20is%20just%20what%20we%20need%20for%20now%2C%20so%20we'll%20be%20using%20it%20for%20a%20while.%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3ESo%20if%20you%20need%2C%20take%20%26amp%3B%20try%20it%2C%20it%20might%20be%20useful%20at%20work.%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJust%20a%20reminder%20please%20use%3C%2FP%3E%3CP%3E(MID(CELL(%22filename%22%2CA1)%2CFIND(%22%5D%22%2CCELL(%22filename%22%2CA1))%2B1%2C255))%3C%2FP%3E%3CP%3Eto%20pick%20up%20a%20worksheet%20name.%3C%2FP%3E%3CP%3ENo%20using%20get.cell()%20function%20with%20name%20manager.%20These%20two%20formulas%2C%20although%20give%20you%20the%20same%20answer%2C%20seems%20to%20work%20differently.%20With%20get.cell()%20you%20may%20encounter%20issues%20when%20you%20try%20to%20save%20your%20figures%20with%20the%20macro%20above.%3C%2FP%3E%3CP%3EDon't%20really%20know%20what's%20happening%20inside%20there%20but%20so%20far%20as%20I%20know%2C%20get.cell()%20doesn't%20link%20to%20the%20tag%20name%20dynamically%20-%26nbsp%3B%20if%20you%20change%20the%20tag%20name%2C%20(MID(CELL(Find%20will%20update%20itself%20instantaneously.%20Get.cell()%20on%20the%20other%20hand%2C%20displays%20the%20old%20answer%20till%20you%20double-click%20%26amp%3B%20activate%20the%20cell%20again%2C%20which%20is%20likely%20the%20root.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGood%20luck%2C%3C%2FP%3E%3CP%3EDummy810%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-867337%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
dummy810
Occasional Contributor

Hey guys,

 

Thanks for your replies.

And eventually I made it work, in a very amateur & dumb manner.

 

So our problem is that we manage our accounts every day, here we have today's book and the one from yesterday.

And there are so many tags, we need to copy & paste the balance sitting in A2 from tag X, Book Yesterday to A2 under tag X Book Today. It's annoying and we made mistakes from time to time. So we decided to do something.

 

1) Our first solution is to link A2 Book Today to A2 Book Yesterday, after updating it we break the link then yesterday's balance is remained in Book Today. Pretty good.

But, we have too many tags - cell() can trace the tag name but it seems that you can't embed that in a link, which means we need to link them one by one, and update them when a tag name changes.

Crap.

 

2) Then I found indirect(), which can work together with cell(), meaning that we don't have to key in tag names separately. Cool.

The bad news is, indirect() creates a dynamic link - you close Book Yesterday, you lose its value in Book Today. Yes, there's a solution - just copy & paste the value to A2. But still, you have to repeat the step for each single worksheet.

Scrap that!

 

3) Eventually I turned to macro. Hmm, don't know where to start, there should be some key words or technical terms but obviously I have no idea. So I was just, looking for something relevant, blindly. And soon I found something like loop through worksheets. And there you go, it solved my problem.

Indirect() can read the value but can't save the value. Instead of manually copy&paste the balance in each worksheet, I tried macro and it works.

 

Here the solution.

A1=Balance

A2=INDIRECT("[book2.xlsx]"&(MID(CELL("filename",A2),FIND("]",CELL("filename",A2))+1,255))&"!A2")

Followed by the Macro

           Sub WorksheetLoop()

                   Dim ws As Worksheet
                           For Each ws In Worksheets

                           If ws.Range("A1") = "Balance" Then
                                ws.Range("A2").Copy
                                ws.Range("A2").PasteSpecial Paste:=xlPasteValues

                                Application.CutCopyMode = False
                           End If
                 Next

              End Sub

Hit the button & all dynamic values in A2s are replaced by fixed figures.

Sorted!

 

Apparently it's not the best but it works, and this is just what we need for now, so we'll be using it for a while.

So if you need, take & try it, it might be useful at work.

 

Just a reminder please use

(MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255))

to pick up a worksheet name.

No using get.cell() function with name manager. These two formulas, although give you the same answer, seems to work differently. With get.cell() you may encounter issues when you try to save your figures with the macro above.

Don't really know what's happening inside there but so far as I know, get.cell() doesn't link to the tag name dynamically -  if you change the tag name, (MID(CELL(Find will update itself instantaneously. Get.cell() on the other hand, displays the old answer till you double-click & activate the cell again, which is likely the root.

 

 

 

Good luck,

Dummy810

10 Replies

@dummy810 

Yes, INDIRECT doesn't work with closed files. The workaround could be, if without VBA, formula like

 

=
IF(<current sheet>="Sheet1", [Book2.xlsx]Sheet1!A1,
IF(<current sheet>="Sheet2", [Book2.xlsx]Sheet2!A1,
IF(<current sheet>="Sheet3", [Book2.xlsx]Sheet3!A1,
IF(<current sheet>="Sheet4", [Book2.xlsx]Sheet4!A1,
IF(<current sheet>="Sheet5", [Book2.xlsx]Sheet5!A1
)))))

 

where <current sheet> you may pick-up from CELL() formula. Even better is to keep helper cells for each sheet with current sheet name and use reference on it. Not very elegant but it could work if you don't have a hundreds of worksheets and don't add/remove sheets, at least frequently.

@Sergei Baklan 

Hi Sergei thanks for your reply,

 

Your suggestion is awesome, and yeah the truth is that we do change our tags very.... often, that's why I want to embed a formula to help tag names update themselves automatically.

 

To your knowledge, is that possible to apply this formula (MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255))

in yours, so we don't have to update worksheet names manually.

 

Regards.

@dummy810 

Hi,

I guess this formula returns current sheet name. Yes, sure, you may use it instead of <current sheet>. But again, it's much better not to complicate the formula but use helper cell. Take it in the place where end-user can't see, in addition you may hide column/row with it, add your formula into this cell and in formula with links use reference on this helper cell.

@Sergei Baklan

Hi Sergei,

 

I've tried your formula it works well.

But yeah it is a bit bulky, haha, sorry to say that, I mean, because we have too many tags here & the number is still growing so it would be a pain to use that.

IF(<current sheet>="Sheet5", [Book2.xlsx]Sheet5!A1
)

 

I believe if I can replace that "Sheet5" following [Book2.xlsx] with cell(), i.e. [book2]Cell() in which cell() to pick up the tag name, then it will help me get what I want in book2 under same tag, and there's no need to change the formula manually.

But in fact it is an external link, so I'm not sure if we make it like that.

So far I've tried to put cell() and [book2] together over and over and over - a big fail.

 

What do you think? Is that because that I use connectors in a wrong way, like misplaced & ' " so excel can't read it, if so can you please give me some ideas. Or we just cannot embed cell() in an external link?

 

Thanks for your time. 

 

 

@dummy810 

You may combine them with INDIRECT and that returns you back to initial problem.

@dummy810  Bulky ! That's  the word you use ! I have been wondering about this whole situation and I am please with your mans advice He will help you ! But Bulky ! THAT IS AN UNDERSTATEMENT ! Good luck in your endeavors ! Richarrut

Yeah you're right. So I might, try something else I guess. Cheers
Haha, I'm losing faith in myself but I will try a bit more. Touch wood, touch wood.

@dummy810  I love your comment your losing faith in your ability ! Ha Ha you will keep trying ! Touch Wood Touch Wood ! Not one person speaks like that here ! Hey Guy Machines are doing us in each day ! and we get paid to help the darn things ! You are fine and you will do fine ! JUST BREATH !

HA Thanks for pump me mate. At last I made it, the solution is not straightforward, kinda stupid. But, it works. So we'll see how it goes. Hope it'll do the job.
Related Conversations
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
cntvertex in Discussions on
13 Replies
Tabs and Dark Mode
cjc2112 in Discussions on
22 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies