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

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -