update Excel File Name (Rename an Excel Sheet), and it auto updates a specific cell in the workbook

%3CLINGO-SUB%20id%3D%22lingo-sub-2108188%22%20slang%3D%22en-US%22%3Eupdate%20Excel%20File%20Name%20(Rename%20an%20Excel%20Sheet)%2C%20and%20it%20auto%20updates%20a%20specific%20cell%20in%20the%20workbook%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2108188%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EI%20do%20have%20a%20question%2C%20that%20I%20seem%20to%20be%20hitting%20a%20wall%20on.%26nbsp%3B%20Is%20it%20possible%20to%20update%20an%20Excel%20File%20Name%20(Rename%20an%20Excel%20Sheet)%2C%20and%20it%20auto%20update%20a%20specific%20cell%20in%20the%20workbook%3F%26nbsp%3B%20Here%20is%20the%20next%20part%20of%20the%20question.%26nbsp%3B%20I%20need%20this%20program%20to%20be%20able%20to%20follow%20the%20file%2C%20regardless%20where%20it%20is%20saved.%26nbsp%3B%20Meaning%2C%20if%20update%20the%20file%20on%20my%20computer%2C%20but%20email%20it%20to%20someone%2C%20I%20want%20the%20formula%20dynamic.%26nbsp%3B%20I%20need%20it%20to%20follow%20the%20sheet%20NOT%20look%20for%20coding%20to%20%E2%80%9CMy%20documents%E2%80%9D%2C%20or%20%E2%80%9CMy%20computer%E2%80%9D%20to%20know%20what%20the%20cell%20name%20is.%26nbsp%3B%20And%20if%20someone%20changes%20the%20file%20name%20on%20their%20computer%2C%20after%20I%20sent%20it%20to%20them%2C%20it%20auto%20updates%20the%20cell%20to%20the%20new%20file%20name%20they%20name%20it.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2108188%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%3CLINGO-SUB%20id%3D%22lingo-sub-2119478%22%20slang%3D%22en-US%22%3ERe%3A%20update%20Excel%20File%20Name%20(Rename%20an%20Excel%20Sheet)%2C%20and%20it%20auto%20updates%20a%20specific%20cell%20in%20the%20workb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2119478%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F533335%22%20target%3D%22_blank%22%3E%40Budman361530%3C%2FA%3E%26nbsp%3B%20Without%20more%20info%20on%20the%20sheets%20and%20file%20structure%20I'm%20in%20the%20dark.%26nbsp%3B%20If%20you%20tried%20before%20and%20couldn't%20get%20the%20macro%20to%20work%2C%20why%20didn't%20it%20work%3F%26nbsp%3B%20Why%20not%20post%20that%20sheet%20or%20at%20least%20the%20macro%20to%20this%20forum%20so%20someone%20can%20help%20you%20fix%20it%20and%20make%20it%20work.%26nbsp%3B%20Make%20sure%20to%20give%20all%20the%20information%20because%20it%20is%20hard%20for%20us%20to%20guess%20what%20you%20mean%20or%20want%20or%20intended.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2114948%22%20slang%3D%22en-US%22%3ERe%3A%20update%20Excel%20File%20Name%20(Rename%20an%20Excel%20Sheet)%2C%20and%20it%20auto%20updates%20a%20specific%20cell%20in%20the%20workb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2114948%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3BYes%20you%20have%20the%20idea%2C%20but%20I%20do%20about%2050%20a%20month.%26nbsp%3B%20Each%20folder%20has%20multilabel%20folders%2C%20word%20docs%2C%20and%20an%20estimating%20program%20that%20has%20nine%20sheets.%26nbsp%3B%20Each%20sheet%20populates%20with%20information%2C%20and%20I%20use%20macro's%20to%20do%20a%20lot%20of%20the%20functions.%26nbsp%3B%20%26nbsp%3BOne%20of%20the%20nine%20sheets%20I%20need%20my%20Forman%20to%20have%20access%20to%2C%20but%20I%20don't%20want%20them%20involved%20with%20the%20rest%20of%20the%20sheets.%26nbsp%3B%20So%20I%20basically%20have%20that%20sheet%20as%20a%20stand%20alone%20sheet%20in%20each%20folder.%26nbsp%3B%20%26nbsp%3BI%20tried%20to%20have%20that%20one%20sheet%20print%20or%20save%20as%20a%20stand%20alone%20Work%20Sheet%2Fbook%2C%20with%20a%20macro%2C%20but%20I%20couldn't%20get%20it%20to%20work.%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2113397%22%20slang%3D%22en-US%22%3ERe%3A%20update%20Excel%20File%20Name%20(Rename%20an%20Excel%20Sheet)%2C%20and%20it%20auto%20updates%20a%20specific%20cell%20in%20the%20workb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2113397%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F380356%22%20target%3D%22_blank%22%3E%40Budman36%3C%2FA%3E%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F533335%22%20target%3D%22_blank%22%3E%40Budman361530%3C%2FA%3E%26nbsp%3BSo%20if%20I%20am%20getting%20the%20gist%20of%20this%20it%20is%20something%20like%3A%20you%20have%20a%20whole%20package%20of%20files%2Fforms%20and%20such%20you%20use%20to%20quote%20a%20job%20and%20let's%20say%20each%20year%20you%20create%20100%20of%20them%20for%20the%20year%20and%20each%20quote%20is%20named%202021-0001%2C%202021-0002%2C%20....%20and%20so%20in%20each%20excel%20file%20you%20want%20relevant%20cells%20that%20refer%20to%20the%20quote%20to%20properly%20use%20the%20actual%20quote%20number.%20But%20you%20are%20using%20some%20batch%20file%20or%20something%20else%20to%20create%20100%20copies%20and%20rename%20them%20to%20all%20the%20%22correct%22%20names%20like%20%22quote%202020-0001%22.%3C%2FP%3E%3CP%3ESo%20can%20you%20make%20that%20program%20also%20change%20a%20cell%20value%20in%20the%20file%3F%26nbsp%3B%20If%20not%20then%20maybe%20you%20should%20make%20a%20macro%20in%20Excel%20VBA%20to%20create%20those%20100%20files%20and%20update%20a%20cell%20in%20each%20file%20accordingly.%26nbsp%3B%20That%20macro%20wouldn't%20be%20hard%20to%20make.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2113374%22%20slang%3D%22en-US%22%3ERe%3A%20update%20Excel%20File%20Name%20(Rename%20an%20Excel%20Sheet)%2C%20and%20it%20auto%20updates%20a%20specific%20cell%20in%20the%20workb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2113374%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F533335%22%20target%3D%22_blank%22%3E%40Budman361530%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOption%20could%20be%20to%20work%20with%20synced%20by%20OneDrive%20folders%2C%20in%20this%20case%20CELL()%20returns%20URL%20which%20includes%20filename%20and%20you%20need%20to%20parse%20it%20by%20bit%20different%20way.%20Or%20use%20Office%20Script%20in%20Excel%20Online%20only%20version.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20both%20cases%20solutions%20won't%20be%20compatible%20with%20one%20for%20the%20network%20shared%20files.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2113370%22%20slang%3D%22en-US%22%3ERe%3A%20update%20Excel%20File%20Name%20(Rename%20an%20Excel%20Sheet)%2C%20and%20it%20auto%20updates%20a%20specific%20cell%20in%20the%20workb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2113370%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F533335%22%20target%3D%22_blank%22%3E%40Budman361530%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20may%20vote%20for%20this%20idea%20here%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fexcel.uservoice.com%2Fforums%2F274580-excel-for-the-web%2Fsuggestions%2F17098492-cell-function-added-to-online%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ECELL%20function%20added%20to%20online%20%E2%80%93%20Welcome%20to%20Excel%E2%80%99s%20Suggestion%20Box!%20(uservoice.com)%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20for%20the%20rest%20I%20agree%20with%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3B%2C%20it%20all%20very%20depends%20on%20concrete%20scenario%20how%20do%20you%20work%20with%20file.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2113369%22%20slang%3D%22en-US%22%3ERe%3A%20update%20Excel%20File%20Name%20(Rename%20an%20Excel%20Sheet)%2C%20and%20it%20auto%20updates%20a%20specific%20cell%20in%20the%20workb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2113369%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3BI%20made%20an%20estimating%20program.%26nbsp%3B%20Each%20quote%2Fjob%20gets%20its%20own%20copy%20of%20this%20program%20in%20a%20unique%20folder.%26nbsp%3B%20In%20this%20folder%20we%20put%20all%20customer%20correspondence%2C%20vendor%20quotes%2C%20etc..%26nbsp%3B%20I%20make%20these%20folders%20(that%20contain%20these%20workbooks)%2050%20to%20100%20at%20a%20time.%26nbsp%3B%20They%20are%20all%20numbered%20consecutively%2C%20so%20I%20use%20a%20%22Renaming%20Program%22%20to%20do%20them%20in%20batches.%26nbsp%3B%20When%20you%20open%20the%20WB%2C%20I%20made%20a%20reference%20cell%20that%20looks%20for%20that%20unique%20number%20in%20the%20name%20and%20it%20auto%20populates%20the%20rest%20of%20the%20book.%26nbsp%3B%2095%25%20of%20our%20work%20is%20done%20on%20a%20company%20shared%20drive%2C%20and%20the%20program%20works%20well.%26nbsp%3B%20The%205%25%20(one%20specific%20sheet)%20needs%20to%20be%20updated%20real%20time%20by%20the%20field%20guys.%26nbsp%3B%20For%20this%20sheet%20alone%2C%20I%20use%20a%20Sharepoint%20with%20a%20link%20that%20I%20post%20on%20our%20on-line%20scheduling%20program.%26nbsp%3B%20That%20also%20works%20well.%26nbsp%3B%20In%20the%20past%20I%20just%20simply%20saved%20a%20sheet%2C%20and%20named%20it%20manually.%26nbsp%3B%20%26nbsp%3BI%20was%20just%20trying%20to%20streamline%20the%20process.%26nbsp%3B%26nbsp%3B95%25%20of%20it%20works%20awesome.%26nbsp%3B%20Looks%20as%20if%20this%205%25%20may%20not%20work.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2113350%22%20slang%3D%22en-US%22%3ERe%3A%20update%20Excel%20File%20Name%20(Rename%20an%20Excel%20Sheet)%2C%20and%20it%20auto%20updates%20a%20specific%20cell%20in%20the%20workb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2113350%22%20slang%3D%22en-US%22%3E%3CP%3Eeven%20if%20I%20did%2C%20I%20don't%20know%20it%20would%20work.%26nbsp%3B%20file%20references%20in%20sharepoint%20are%2C%20let's%20say%20different.%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20originally%20said%20the%20problem%20was%20that%20you%20were%20e-mailing%20the%20file%20to%20people%20and%20they%20would%20save%20it%20on%20their%20computers%20and%20often%20in%20the%20process%20they%20would%20change%20the%20name.%26nbsp%3B%20If%20it%20is%20on%20sharepoint%2C%20why%20would%20the%20name%20change%3F%26nbsp%3B%20What%20is%20it%20that%20you%20need%20this%20name%20for%3F%26nbsp%3B%20For%20example%2C%20on%20the%20desktop%20you%20can%20just%20give%20an%20address%20to%20point%20to%20other%20files%20but%20in%20sharepoint%20due%20to%20it%20being%20a%20server%20and%20security%20things%20(and%20honestly%20I%20guess%20I%20don't%20really%20know%20the%20exact%20reasons)%20it%20isn't%20that%20easy.%26nbsp%3B%20But%20regardless%20you%20are%20asking%20for%20the%20name%20of%20itself%2C%20not%20some%20other%20file.%26nbsp%3B%20I%20still%20not%20clear%20why.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2113298%22%20slang%3D%22en-US%22%3ERe%3A%20update%20Excel%20File%20Name%20(Rename%20an%20Excel%20Sheet)%2C%20and%20it%20auto%20updates%20a%20specific%20cell%20in%20the%20workb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2113298%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%3BThat%20would%20do%20it!%26nbsp%3B%20Do%20you%20know%20a%20workaround%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2113294%22%20slang%3D%22en-US%22%3ERe%3A%20update%20Excel%20File%20Name%20(Rename%20an%20Excel%20Sheet)%2C%20and%20it%20auto%20updates%20a%20specific%20cell%20in%20the%20workb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2113294%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F533335%22%20target%3D%22_blank%22%3E%40Budman361530%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECELL(%22filename%22)%20is%20not%20implemented%20for%20Excel%20Online%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2113268%22%20slang%3D%22en-US%22%3ERe%3A%20update%20Excel%20File%20Name%20(Rename%20an%20Excel%20Sheet)%2C%20and%20it%20auto%20updates%20a%20specific%20cell%20in%20the%20workb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2113268%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3BThis%20worked%20very%20well%2C%20on%20a%20local%20drive%2C%20personal%20computers%2C%20etc.%2C%20but%20it%20doesn't%20work%20when%20uploaded%20to%20sharepoint%3F%26nbsp%3B%20Any%20ideas%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2109118%22%20slang%3D%22en-US%22%3ERe%3A%20update%20Excel%20File%20Name%20(Rename%20an%20Excel%20Sheet)%2C%20and%20it%20auto%20updates%20a%20specific%20cell%20in%20the%20workb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2109118%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%3BThis%20worked%20as%20well.%20%26nbsp%3Bthank%20you%20both!%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2109115%22%20slang%3D%22en-US%22%3ERe%3A%20update%20Excel%20File%20Name%20(Rename%20an%20Excel%20Sheet)%2C%20and%20it%20auto%20updates%20a%20specific%20cell%20in%20the%20workb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2109115%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3Bthat%20worked!!!%20%26nbsp%3Bthank%20you!%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2109081%22%20slang%3D%22en-US%22%3ERe%3A%20update%20Excel%20File%20Name%20(Rename%20an%20Excel%20Sheet)%2C%20and%20it%20auto%20updates%20a%20specific%20cell%20in%20the%20workb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2109081%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F380356%22%20target%3D%22_blank%22%3E%40Budman36%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20variant%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DLET(txt%2C%20A1%2C%20delim%2C%20%22.%22%2C%20nDelim%2C%20LEN(txt)-LEN(SUBSTITUTE(txt%2C%20delim%2C%22%22))%2C%0A%20%20ch%2C%20UNICHAR(9999)%2C%0A%20%20n%2C%20SEQUENCE(1%2CnDelim%2B1)%2C%0A%20%20nn%2C%20SEQUENCE(1%2CnDelim%2B1%2C2)%2C%0A%20%20startPos%2CIFERROR(FIND(ch%2CSUBSTITUTE(txt%2Cdelim%2Cch%2Cn-1))%2B1%2C1)%2C%0A%20%20numChars%2C%20IFERROR(INDEX(startPos%2Cnn)-1%2CLEN(txt)%2B1)-startPos%2C%0A%20%20TRIM(MID(txt%2CstartPos%2CnumChars))%0A)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3Efor%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20593px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F250775iE20DC0B61D242D5B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2109058%22%20slang%3D%22en-US%22%3ERe%3A%20update%20Excel%20File%20Name%20(Rename%20an%20Excel%20Sheet)%2C%20and%20it%20auto%20updates%20a%20specific%20cell%20in%20the%20workb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2109058%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F380356%22%20target%3D%22_blank%22%3E%40Budman36%3C%2FA%3E%26nbsp%3BYes%20you%20can%20use%20similar%20techniques%20to%20further%20divide%20the%20filename.%26nbsp%3B%20I%20assume%20a%20period%20(.)%20is%20between%20each%20part%20so%20do%20you%20want%20the%20full%20name%20in%201%20cell%20and%20then%20break%20it%20down%20or%20only%20have%20the%20parts%3F%3C%2FP%3E%3CP%3Efor%20example%20if%20the%20%3DMID()%20formula%20is%20in%20cell%20A1%26nbsp%3B%20then%20you%20could%20paste%20this%20in%20A2%20and%20copy%20down%3A%3C%2FP%3E%3CP%3E%3DTRIM(MID(SUBSTITUTE(%24A%241%2C%22.%22%2CREPT(%22%20%22%2CLEN(%24A%241)))%2CLEN(%24A%241)*(ROWS(%24A%241%3AA1)-1)%2B1%2CLEN(%24A%241)))%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2109023%22%20slang%3D%22en-US%22%3ERe%3A%20update%20Excel%20File%20Name%20(Rename%20an%20Excel%20Sheet)%2C%20and%20it%20auto%20updates%20a%20specific%20cell%20in%20the%20workb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2109023%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3BThe%20MID%20works%2C%20but%20I%20am%20hitting%20a%20road%20block.%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20my%20example%20of%20a%20book%20name%3A%3C%2FP%3E%3CP%3E21MJNXXX.%20Customer%20Name.%20Job%20Name.%20REV%201%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20need%20to%20separate%20each%20section%20into%20a%20cell%20of%20there%20own...%26nbsp%3B%3C%2FP%3E%3CP%3E21MJNXXX%3C%2FP%3E%3CP%3ECustomer%20Name%3C%2FP%3E%3CP%3EJob%20Name%26nbsp%3B%3C%2FP%3E%3CP%3EREV%201%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20%22Text%20to%20Columns%22%20function%20will%20not%20work%20because%20it%20shows%20the%20formula.%20%26nbsp%3BNot%20the%20actual%20text.%20%26nbsp%3BI%20have%20tried%20%3DLEFT%2C%20%3DLEFT(RIGHT%2C%20....%20%3DLEFT(MID...%20but%20I%20can't%20seem%20to%20get%20this%20right%3F%20%26nbsp%3BIs%20it%20possible%20do%20the%20text%20to%20columns%20with%20code%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2108324%22%20slang%3D%22en-US%22%3ERe%3A%20update%20Excel%20File%20Name%20(Rename%20an%20Excel%20Sheet)%2C%20and%20it%20auto%20updates%20a%20specific%20cell%20in%20the%20workb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2108324%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F380356%22%20target%3D%22_blank%22%3E%40Budman36%3C%2FA%3E%26nbsp%3B%20It%20sounds%20like%20you%20want%20the%20filename%20in%20a%20cell.%26nbsp%3B%20The%20function%20CELL()%20offers%20that%20sort%20of.%26nbsp%3B%20CELL(%22filename%22)%20actually%20gives%20the%20full%20path%2Freference%20but%20with%20some%20additional%20work%20you%20can%20have%20it%20trim%20just%20the%20filename%20out%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DLET(path%2CCELL(%22filename%22)%2Cstart%2CSEARCH(%22%5B%22%2Cpath)%2B1%2Cend%2CSEARCH(%22%5D%22%2Cpath)%2Cfn%2CMID(path%2Cstart%2Cend-start)%2Cfn)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3Eif%20you%20don't%20have%20the%20newest%20version%20of%20Excel%20with%20the%20LET()%20function%20you%20can%20use%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DMID(CELL(%22filename%22)%2CSEARCH(%22%5B%22%2CCELL(%22filename%22))%2B1%2CSEARCH(%22%5D%22%2CCELL(%22filename%22))-SEARCH(%22%5B%22%2CCELL(%22filename%22))-1)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3Ebut%20maybe%20the%20full%20path%20would%20be%20even%20better%20for%20you%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2133624%22%20slang%3D%22en-US%22%3ERe%3A%20update%20Excel%20File%20Name%20(Rename%20an%20Excel%20Sheet)%2C%20and%20it%20auto%20updates%20a%20specific%20cell%20in%20the%20workb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2133624%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3BSee%20your%20point....%20I%20was%20trying%20to%20keep%20it%20simple%2C%20and%20I%20was%20making%20things%20more%20complicated.%26nbsp%3B%20Here%20is%20the%20the%20coding%20of%20my%20macro.%26nbsp%3B%20%26nbsp%3BFirst%20I%20am%20trying%20to%20just%20get%20it%20to%20work%2C%20and%20I%20can't.%26nbsp%3B%20Next%20I%20was%20trying%20to%20get%20it%20to%20preform%20like%20another%20Macro%20I%20have%2C%20that%20works%20for%20saving%20different%20sheets%20in%20a%20PDF%20in%20whatever%20folder%20they%20are%20in%2C%20with%20whatever%20name%20the%20file%20is.%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFirst%20Try....%20wont%20save%20as%20a%20Macro%20enabled%20WB.%20In%20%22debug%22%20it%20show%20the%20wb.saveas%20line%20as%20the%20issue.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESub%20sb_Copy_Save_Worksheet_As_Workbook()%3CBR%20%2F%3EDim%20wb%20As%20Workbook%3CBR%20%2F%3ESet%20wb%20%3D%20Workbooks.Add%3CBR%20%2F%3EThisWorkbook.Sheets(%22Task%20Sheet.%22).Copy%20Before%3A%3Dwb.Sheets(1)%3CBR%20%2F%3Ewb.SaveAs%20%22C%3A%5CUsers%5CBudman361530%5CDocuments%5CNew%20folder%5CTasksheet.xlsx%22%3CBR%20%2F%3EEnd%20Sub%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESecond%20Try...%20wont%20allow%20me%20to%20save%20as%20an%20.xlsm%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESub%20sb_Copy_Save_Worksheet_As_Workbook()%3CBR%20%2F%3EDim%20wb%20As%20Workbook%3CBR%20%2F%3ESet%20wb%20%3D%20Workbooks.Add%3CBR%20%2F%3EThisWorkbook.Sheets(%22Task%20Sheet.%22).Copy%20Before%3A%3Dwb.Sheets(1)%3CBR%20%2F%3Ewb.SaveAs%20%22C%3A%5CUsers%5CBudman361530%5CDocuments%5CNew%20folder%5CTasksheet.xlsm%22%3CBR%20%2F%3EEnd%20Sub%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EUlitmaly%20tyring%20to%20work%20as%20this%20code....%2C%20but%20saving%20as%20a%20Macro%20WB%20vs.%20a%20PDF.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESub%20MacroContractQuote()%3C%2FP%3E%3CP%3E'%3CBR%20%2F%3E'%20Macro1%20Macro%3CBR%20%2F%3E'%3CBR%20%2F%3E'%3CBR%20%2F%3E'ChDir%20_%3CBR%20%2F%3E'%22Z%3A%5CShared%5CBudman361530%20Shared%5CBudman361530%20Quote%20and%20Jobs%5C01%20-%20Master%20Quote%20Folder%20Templet%20REV%201.1%20DO%20NOT%20USE%20WORKING%20ON%20THIS%22%3CBR%20%2F%3E'ActiveSheet.ExportAsFixedFormat%20Type%3A%3DxlTypePDF%2C%20Filename%3A%3D%20_%3CBR%20%2F%3E'%22Z%3A%5CShared%5CBudman361530%20Shared%5CBudman361530%20Quote%20and%20Jobs%5C01%20-%20Master%20Quote%20Folder%20Templet%20REV%201.1%20DO%20NOT%20USE%20WORKING%20ON%20THIS%5C20MJNXXXX%20REV%201.1%20-%20Copy.pdf%22%20_%3CBR%20%2F%3E'%2C%20Quality%3A%3DxlQualityStandard%2C%20IncludeDocProperties%3A%3DTrue%2C%20IgnorePrintAreas%20_%3CBR%20%2F%3E'%3A%3DFalse%2C%20OpenAfterPublish%3A%3DFalse%3CBR%20%2F%3EDim%20strPath%20As%20String%3CBR%20%2F%3EDim%20strName%20As%20String%3CBR%20%2F%3EDim%20strFile%20As%20String%3CBR%20%2F%3EDim%20strPathFile%20As%20String%3CBR%20%2F%3EDim%20myFile%20As%20Variant%3CBR%20%2F%3EstrPath%20%3D%20ThisWorkbook.Path%3CBR%20%2F%3EIf%20strPath%20%3D%20%22%22%20Then%3CBR%20%2F%3EstrPath%20%3D%20Application.DefaultFilePath%3CBR%20%2F%3EEnd%20If%3CBR%20%2F%3EstrPath%20%3D%20strPath%20%26amp%3B%20%22%2FContract%20Quote%20%22%3CBR%20%2F%3E%3CBR%20%2F%3E'Getting%20the%20file%20name%20dynamically%3CBR%20%2F%3EstrName%20%3D%20Left(ActiveWorkbook.Name%2C%20(InStrRev(ActiveWorkbook.Name%2C%20%22.%22%2C%20-1%2C%20vbTextCompare)%20-%201))%3CBR%20%2F%3E%3CBR%20%2F%3E'Creating%20the%20new%20file%20location%20and%20name%3CBR%20%2F%3EstrFile%20%3D%20strName%20%26amp%3B%20%22.pdf%22%3CBR%20%2F%3EstrPathFile%20%3D%20strPath%20%26amp%3B%20strFile%3CBR%20%2F%3E'export%20to%20PDF%20in%20current%20folder%3CBR%20%2F%3EActiveSheet.ExportAsFixedFormat%20_%3CBR%20%2F%3EType%3A%3DxlTypePDF%2C%20_%3CBR%20%2F%3EFilename%3A%3DstrPathFile%2C%20_%3CBR%20%2F%3EQuality%3A%3DxlQualityStandard%2C%20_%3CBR%20%2F%3EIncludeDocProperties%3A%3DTrue%2C%20_%3CBR%20%2F%3EIgnorePrintAreas%3A%3DFalse%2C%20_%3CBR%20%2F%3EOpenAfterPublish%3A%3DFalse%3CBR%20%2F%3E'confirmation%20message%20with%20file%20info%3CBR%20%2F%3EMsgBox%20%22PDF%20file%20has%20been%20created%3A%20%22%20_%3CBR%20%2F%3E%26amp%3B%20vbCrLf%20_%3CBR%20%2F%3E%26amp%3B%20strPathFile%3CBR%20%2F%3E'MsgBox%20(%22New%20file%3A%20%22%20%26amp%3B%20strPathFile)%3CBR%20%2F%3EEnd%20Sub%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2136097%22%20slang%3D%22en-US%22%3ERe%3A%20update%20Excel%20File%20Name%20(Rename%20an%20Excel%20Sheet)%2C%20and%20it%20auto%20updates%20a%20specific%20cell%20in%20the%20workb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2136097%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F533335%22%20target%3D%22_blank%22%3E%40Budman361530%3C%2FA%3E%26nbsp%3BThe%20SaveAs%20command%20is%20trying%20to%20save%20as%20the%20same%20type%20it%20is%20(default%20is%20non-macro)%20so%20you%20need%20to%20force%20it%20to%20be%20xlsm%20(adding%20the%20extension%20on%20the%20name%20is%20not%20enough).%20Add%20xlOpenXMLWorkbookMacroEnabled%20to%20your%20SaveAs%20line%20like%20this%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Ewb.SaveAs%20%22C%3A%5CUsers%5CBudman361530%5CDocuments%5CNew%20folder%5CTasksheet.xlsm%22%2C%20xlOpenXMLWorkbookMacroEnabled%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2137400%22%20slang%3D%22en-US%22%3ERe%3A%20update%20Excel%20File%20Name%20(Rename%20an%20Excel%20Sheet)%2C%20and%20it%20auto%20updates%20a%20specific%20cell%20in%20the%20workb%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2137400%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3BThat%20did%20the%20trick%20for%20saving%20in%20a%20Macro.%26nbsp%3B%20Thank%20you.%26nbsp%3B%20What%20am%20I%20doing%20wrong%20with%20trying%20to%20get%20the%20code%20to%20save%20dynamically%2C%20both%20Name%20and%20Location%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20code%20that%20I%20made%20that%20saves%20pages%20in%20a%20PDF%2C%20to%20whatever%20folder%20the%20WB%20is%20in%20at%20that%20moment%2C%20and%20pulls%20the%20name%20from%20the%20name%20of%20the%20workbook%20it%20self.%26nbsp%3B%20example....%20if%20the%20WB%20was%20located%20in%20folder%20X%2C%20and%20was%20named%26nbsp%3B%2020MJNXXX.%20Customer%201.%20Job%201.%20REV.%201%2C%26nbsp%3B%20The%20PDF%20would%20be%20called%20Contract%20Quote.%2020MJNXXX.%20Customer%201.%20Job%201.%20REV.%201%2C%20and%20save%20automatically%20in%20folder%20X.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20the%20code...%3C%2FP%3E%3CP%3E%3CBR%20%2F%3ESub%20MacroContractQuote()%3C%2FP%3E%3CP%3E'%3CBR%20%2F%3E'%20Macro1%20Macro%3CBR%20%2F%3E'%3CBR%20%2F%3E'%3CBR%20%2F%3E'ChDir%20_%3CBR%20%2F%3E'%22Z%3A%5CShared%5CBudman%20Shared%5CBudman%20Quote%20and%20Jobs%5C01%20-%20Master%20Quote%20Folder%20Templet%20REV.%201%22%3CBR%20%2F%3E'ActiveSheet.ExportAsFixedFormat%20Type%3A%3DxlTypePDF%2C%20Filename%3A%3D%20_%3CBR%20%2F%3E'%22Z%3A%5CShared%5CBudman%20Shared%5CBudman%20Quote%20and%20Jobs%5C01%20-%20Master%20Quote%20Folder%20Templet%20REV.%201%22%20_%3CBR%20%2F%3E'%2C%20Quality%3A%3DxlQualityStandard%2C%20IncludeDocProperties%3A%3DTrue%2C%20IgnorePrintAreas%20_%3CBR%20%2F%3E'%3A%3DFalse%2C%20OpenAfterPublish%3A%3DFalse%3CBR%20%2F%3EDim%20strPath%20As%20String%3CBR%20%2F%3EDim%20strName%20As%20String%3CBR%20%2F%3EDim%20strFile%20As%20String%3CBR%20%2F%3EDim%20strPathFile%20As%20String%3CBR%20%2F%3EDim%20myFile%20As%20Variant%3CBR%20%2F%3EstrPath%20%3D%20ThisWorkbook.Path%3CBR%20%2F%3EIf%20strPath%20%3D%20%22%22%20Then%3CBR%20%2F%3EstrPath%20%3D%20Application.DefaultFilePath%3CBR%20%2F%3EEnd%20If%3CBR%20%2F%3EstrPath%20%3D%20strPath%20%26amp%3B%20%22%2FContract%20Quote%20%22%3CBR%20%2F%3E%3CBR%20%2F%3E'Getting%20the%20file%20name%20dynamically%3CBR%20%2F%3EstrName%20%3D%20Left(ActiveWorkbook.Name%2C%20(InStrRev(ActiveWorkbook.Name%2C%20%22.%22%2C%20-1%2C%20vbTextCompare)%20-%201))%3CBR%20%2F%3E%3CBR%20%2F%3E'Creating%20the%20new%20file%20location%20and%20name%3CBR%20%2F%3EstrFile%20%3D%20strName%20%26amp%3B%20%22.pdf%22%3CBR%20%2F%3EstrPathFile%20%3D%20strPath%20%26amp%3B%20strFile%3CBR%20%2F%3E'export%20to%20PDF%20in%20current%20folder%3CBR%20%2F%3EActiveSheet.ExportAsFixedFormat%20_%3CBR%20%2F%3EType%3A%3DxlTypePDF%2C%20_%3CBR%20%2F%3EFilename%3A%3DstrPathFile%2C%20_%3CBR%20%2F%3EQuality%3A%3DxlQualityStandard%2C%20_%3CBR%20%2F%3EIncludeDocProperties%3A%3DTrue%2C%20_%3CBR%20%2F%3EIgnorePrintAreas%3A%3DFalse%2C%20_%3CBR%20%2F%3EOpenAfterPublish%3A%3DFalse%3CBR%20%2F%3E'confirmation%20message%20with%20file%20info%3CBR%20%2F%3EMsgBox%20%22PDF%20file%20has%20been%20created%3A%20%22%20_%3CBR%20%2F%3E%26amp%3B%20vbCrLf%20_%3CBR%20%2F%3E%26amp%3B%20strPathFile%3CBR%20%2F%3E'MsgBox%20(%22New%20file%3A%20%22%20%26amp%3B%20strPathFile)%3CBR%20%2F%3EEnd%20Sub%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20get%20the%20same%20type%20of%20results%20from%20the%20excel%20saving%20macro%2C%20but%20it's%20not%20working...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESub%20sb_Copy_Save_Worksheet_As_Workbook()%3CBR%20%2F%3EDim%20wb%20As%20Workbook%3CBR%20%2F%3ESet%20wb%20%3D%20Workbooks.Add%3CBR%20%2F%3E'Getting%20the%20file%20name%20dynamically%3CBR%20%2F%3EstrName%20%3D%20(Left(ActiveWorkbook.Name%2C(InStrRev(ActiveWorkbook.Name%2C%20%22.%22%2C%20-1%2C%22JOB%20PO%20List%22)%20-%201))%3CBR%20%2F%3EThisWorkbook.Sheets.Copy%20Before%3A%3Dwb.Sheets(1)%3CBR%20%2F%3Ewb.SaveAs%20strPath%20'current%20folder'%2C%20xlOpenXMLWorkbookMacroEnabled%3CBR%20%2F%3EEnd%20Sub%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

I do have a question, that I seem to be hitting a wall on.  Is it possible to update an Excel File Name (Rename an Excel Sheet), and it auto update a specific cell in the workbook?  Here is the next part of the question.  I need this program to be able to follow the file, regardless where it is saved.  Meaning, if update the file on my computer, but email it to someone, I want the formula dynamic.  I need it to follow the sheet NOT look for coding to “My documents”, or “My computer” to know what the cell name is.  And if someone changes the file name on their computer, after I sent it to them, it auto updates the cell to the new file name they name it.

20 Replies

@Budman36  It sounds like you want the filename in a cell.  The function CELL() offers that sort of.  CELL("filename") actually gives the full path/reference but with some additional work you can have it trim just the filename out:

=LET(path,CELL("filename"),start,SEARCH("[",path)+1,end,SEARCH("]",path),fn,MID(path,start,end-start),fn)

if you don't have the newest version of Excel with the LET() function you can use:

=MID(CELL("filename"),SEARCH("[",CELL("filename"))+1,SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))-1)

but maybe the full path would be even better for you?

 

@mtarler The MID works, but I am hitting a road block.   

 

Here is my example of a book name:

21MJNXXX. Customer Name. Job Name. REV 1

 

I need to separate each section into a cell of there own... 

21MJNXXX

Customer Name

Job Name 

REV 1

 

The "Text to Columns" function will not work because it shows the formula.  Not the actual text.  I have tried =LEFT, =LEFT(RIGHT, .... =LEFT(MID... but I can't seem to get this right?  Is it possible do the text to columns with code?

@Budman36 Yes you can use similar techniques to further divide the filename.  I assume a period (.) is between each part so do you want the full name in 1 cell and then break it down or only have the parts?

for example if the =MID() formula is in cell A1  then you could paste this in A2 and copy down:

=TRIM(MID(SUBSTITUTE($A$1,".",REPT(" ",LEN($A$1))),LEN($A$1)*(ROWS($A$1:A1)-1)+1,LEN($A$1)))

 

@Budman36 

As variant

=LET(txt, A1, delim, ".", nDelim, LEN(txt)-LEN(SUBSTITUTE(txt, delim,"")),
  ch, UNICHAR(9999),
  n, SEQUENCE(1,nDelim+1),
  nn, SEQUENCE(1,nDelim+1,2),
  startPos,IFERROR(FIND(ch,SUBSTITUTE(txt,delim,ch,n-1))+1,1),
  numChars, IFERROR(INDEX(startPos,nn)-1,LEN(txt)+1)-startPos,
  TRIM(MID(txt,startPos,numChars))
)

for

image.png

 

@mtarler This worked very well, on a local drive, personal computers, etc., but it doesn't work when uploaded to sharepoint?  Any ideas?

@Budman361530 

CELL("filename") is not implemented for Excel Online

even if I did, I don't know it would work.  file references in sharepoint are, let's say different. 

You originally said the problem was that you were e-mailing the file to people and they would save it on their computers and often in the process they would change the name.  If it is on sharepoint, why would the name change?  What is it that you need this name for?  For example, on the desktop you can just give an address to point to other files but in sharepoint due to it being a server and security things (and honestly I guess I don't really know the exact reasons) it isn't that easy.  But regardless you are asking for the name of itself, not some other file.  I still not clear why.

@mtarler I made an estimating program.  Each quote/job gets its own copy of this program in a unique folder.  In this folder we put all customer correspondence, vendor quotes, etc..  I make these folders (that contain these workbooks) 50 to 100 at a time.  They are all numbered consecutively, so I use a "Renaming Program" to do them in batches.  When you open the WB, I made a reference cell that looks for that unique number in the name and it auto populates the rest of the book.  95% of our work is done on a company shared drive, and the program works well.  The 5% (one specific sheet) needs to be updated real time by the field guys.  For this sheet alone, I use a Sharepoint with a link that I post on our on-line scheduling program.  That also works well.  In the past I just simply saved a sheet, and named it manually.   I was just trying to streamline the process.  95% of it works awesome.  Looks as if this 5% may not work.  

@Budman361530 

You may vote for this idea here CELL function added to online – Welcome to Excel’s Suggestion Box! (uservoice.com) 

As for the rest I agree with @mtarler , it all very depends on concrete scenario how do you work with file.

@Budman361530 

Option could be to work with synced by OneDrive folders, in this case CELL() returns URL which includes filename and you need to parse it by bit different way. Or use Office Script in Excel Online only version.

 

In both cases solutions won't be compatible with one for the network shared files.

@Budman36 @Budman361530 So if I am getting the gist of this it is something like: you have a whole package of files/forms and such you use to quote a job and let's say each year you create 100 of them for the year and each quote is named 2021-0001, 2021-0002, .... and so in each excel file you want relevant cells that refer to the quote to properly use the actual quote number. But you are using some batch file or something else to create 100 copies and rename them to all the "correct" names like "quote 2020-0001".

So can you make that program also change a cell value in the file?  If not then maybe you should make a macro in Excel VBA to create those 100 files and update a cell in each file accordingly.  That macro wouldn't be hard to make. 

@mtarler Yes you have the idea, but I do about 50 a month.  Each folder has multilabel folders, word docs, and an estimating program that has nine sheets.  Each sheet populates with information, and I use macro's to do a lot of the functions.   One of the nine sheets I need my Forman to have access to, but I don't want them involved with the rest of the sheets.  So I basically have that sheet as a stand alone sheet in each folder.   I tried to have that one sheet print or save as a stand alone Work Sheet/book, with a macro, but I couldn't get it to work.   

@Budman361530  Without more info on the sheets and file structure I'm in the dark.  If you tried before and couldn't get the macro to work, why didn't it work?  Why not post that sheet or at least the macro to this forum so someone can help you fix it and make it work.  Make sure to give all the information because it is hard for us to guess what you mean or want or intended.

@mtarler See your point.... I was trying to keep it simple, and I was making things more complicated.  Here is the the coding of my macro.   First I am trying to just get it to work, and I can't.  Next I was trying to get it to preform like another Macro I have, that works for saving different sheets in a PDF in whatever folder they are in, with whatever name the file is.   

 

First Try.... wont save as a Macro enabled WB. In "debug" it show the wb.saveas line as the issue.

 

Sub sb_Copy_Save_Worksheet_As_Workbook()
Dim wb As Workbook
Set wb = Workbooks.Add
ThisWorkbook.Sheets("Task Sheet.").Copy Before:=wb.Sheets(1)
wb.SaveAs "C:\Users\Budman361530\Documents\New folder\Tasksheet.xlsx"
End Sub

 

Second Try... wont allow me to save as an .xlsm

 

Sub sb_Copy_Save_Worksheet_As_Workbook()
Dim wb As Workbook
Set wb = Workbooks.Add
ThisWorkbook.Sheets("Task Sheet.").Copy Before:=wb.Sheets(1)
wb.SaveAs "C:\Users\Budman361530\Documents\New folder\Tasksheet.xlsm"
End Sub


Ulitmaly tyring to work as this code...., but saving as a Macro WB vs. a PDF.

 

Sub MacroContractQuote()

'
' Macro1 Macro
'
'
'ChDir _
'"Z:\Shared\Budman361530 Shared\Budman361530 Quote and Jobs\01 - Master Quote Folder Templet REV 1.1 DO NOT USE WORKING ON THIS"
'ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
'"Z:\Shared\Budman361530 Shared\Budman361530 Quote and Jobs\01 - Master Quote Folder Templet REV 1.1 DO NOT USE WORKING ON THIS\20MJNXXXX REV 1.1 - Copy.pdf" _
', Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
':=False, OpenAfterPublish:=False
Dim strPath As String
Dim strName As String
Dim strFile As String
Dim strPathFile As String
Dim myFile As Variant
strPath = ThisWorkbook.Path
If strPath = "" Then
strPath = Application.DefaultFilePath
End If
strPath = strPath & "/Contract Quote "

'Getting the file name dynamically
strName = Left(ActiveWorkbook.Name, (InStrRev(ActiveWorkbook.Name, ".", -1, vbTextCompare) - 1))

'Creating the new file location and name
strFile = strName & ".pdf"
strPathFile = strPath & strFile
'export to PDF in current folder
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=strPathFile, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
'confirmation message with file info
MsgBox "PDF file has been created: " _
& vbCrLf _
& strPathFile
'MsgBox ("New file: " & strPathFile)
End Sub

 

@Budman361530 The SaveAs command is trying to save as the same type it is (default is non-macro) so you need to force it to be xlsm (adding the extension on the name is not enough). Add xlOpenXMLWorkbookMacroEnabled to your SaveAs line like this:

wb.SaveAs "C:\Users\Budman361530\Documents\New folder\Tasksheet.xlsm", xlOpenXMLWorkbookMacroEnabled

@mtarler That did the trick for saving in a Macro.  Thank you.  What am I doing wrong with trying to get the code to save dynamically, both Name and Location?

 

I have a code that I made that saves pages in a PDF, to whatever folder the WB is in at that moment, and pulls the name from the name of the workbook it self.  example.... if the WB was located in folder X, and was named  20MJNXXX. Customer 1. Job 1. REV. 1,  The PDF would be called Contract Quote. 20MJNXXX. Customer 1. Job 1. REV. 1, and save automatically in folder X. 

 

Here is the code...


Sub MacroContractQuote()

'
' Macro1 Macro
'
'
'ChDir _
'"Z:\Shared\Budman Shared\Budman Quote and Jobs\01 - Master Quote Folder Templet REV. 1"
'ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
'"Z:\Shared\Budman Shared\Budman Quote and Jobs\01 - Master Quote Folder Templet REV. 1" _
', Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
':=False, OpenAfterPublish:=False
Dim strPath As String
Dim strName As String
Dim strFile As String
Dim strPathFile As String
Dim myFile As Variant
strPath = ThisWorkbook.Path
If strPath = "" Then
strPath = Application.DefaultFilePath
End If
strPath = strPath & "/Contract Quote "

'Getting the file name dynamically
strName = Left(ActiveWorkbook.Name, (InStrRev(ActiveWorkbook.Name, ".", -1, vbTextCompare) - 1))

'Creating the new file location and name
strFile = strName & ".pdf"
strPathFile = strPath & strFile
'export to PDF in current folder
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=strPathFile, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
'confirmation message with file info
MsgBox "PDF file has been created: " _
& vbCrLf _
& strPathFile
'MsgBox ("New file: " & strPathFile)
End Sub

 

I am trying to get the same type of results from the excel saving macro, but it's not working...

 

Sub sb_Copy_Save_Worksheet_As_Workbook()
Dim wb As Workbook
Set wb = Workbooks.Add
'Getting the file name dynamically
strName = (Left(ActiveWorkbook.Name,(InStrRev(ActiveWorkbook.Name, ".", -1,"JOB PO List") - 1))
ThisWorkbook.Sheets.Copy Before:=wb.Sheets(1)
wb.SaveAs strPath 'current folder', xlOpenXMLWorkbookMacroEnabled
End Sub