excel - Get part of file name and insert into Cell -



excel - Get part of file name and insert into Cell -

i have setup sheet re-create 1 page, , create new workbook info , save new file name.

my code saving file -

newname = "hotterpgpalletdespatch - ref " & format$(date, "mmddyyyy") _ & "-" & format(cstr(now), "hhmm") & "" activeworkbook.saveas filename:=thisworkbook.path & "\new\" & newname, fileformat _ :=51, createbackup:=false

i want take date/time after word ref , insert cell g2.

how this? (i don't want current date/time 1 time again may alter need have specific numbers file path.

assuming workbook has been saved in appropriate name format, utilize formula in g2.

=trim(left(substitute(mid(cell("filename"), find("ref ",cell("filename"))+4, 99), ".", rept(" ", 99)), 99))

excel vba

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -