tag:blogger.com,1999:blog-28492262.post5276812354345833199..comments2023-12-27T22:22:25.151-08:00Comments on VBA Tips & Tricks: How to extract file name from FullPath string using VBAUnknownnoreply@blogger.comBlogger9125tag:blogger.com,1999:blog-28492262.post-27933001542753789902016-05-18T09:06:00.795-07:002016-05-18T09:06:00.795-07:00I'm getting an expected array error for the UB...I'm getting an expected array error for the UBound, any ideas?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-28492262.post-71984836970093376442013-02-12T18:45:23.285-08:002013-02-12T18:45:23.285-08:00Extract filename without extension:
sFName = Left(...Extract filename without extension:<br />sFName = Left(sFName, InStrRev(sFName, ".") - 1)Unknownhttps://www.blogger.com/profile/12508942012547566997noreply@blogger.comtag:blogger.com,1999:blog-28492262.post-26094018882098546182013-02-12T18:44:44.844-08:002013-02-12T18:44:44.844-08:00Extract Filename without the extension:
sFName = L...Extract Filename without the extension:<br />sFName = Left(sFName, InStrRev(sFName, ".") - 1)Unknownhttps://www.blogger.com/profile/12508942012547566997noreply@blogger.comtag:blogger.com,1999:blog-28492262.post-20158038236946665732012-12-01T19:25:46.900-08:002012-12-01T19:25:46.900-08:00Thanks a lot. I used used your code and was great ...Thanks a lot. I used used your code and was great helpajit_raghuhttps://www.blogger.com/profile/10169907791031230200noreply@blogger.comtag:blogger.com,1999:blog-28492262.post-18779815423773898082012-12-01T10:04:22.503-08:002012-12-01T10:04:22.503-08:00can anyone tell me how to get only file name witho...can anyone tell me how to get only file name without its extension ??<br />Thanks in advance..Sameer Shaikhttps://www.blogger.com/profile/17736817229781899785noreply@blogger.comtag:blogger.com,1999:blog-28492262.post-52289008950960871712012-07-09T21:13:23.692-07:002012-07-09T21:13:23.692-07:00sFileName = Dir(strFilePath)sFileName = Dir(strFilePath)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-28492262.post-12597138877478946762012-05-14T17:06:28.348-07:002012-05-14T17:06:28.348-07:00I used Shasur logic. Thanks for the great tips.Sav...I used Shasur logic. Thanks for the great tips.Saved my research time.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-28492262.post-37940341712485037342010-07-08T01:37:54.936-07:002010-07-08T01:37:54.936-07:00Bob..You are right. This is very simple as we are ...Bob..You are right. This is very simple as we are using only 2 functions.<br /><br />sFileName=split(strFilePath,"\")(ubound(split(strFilePath,"\")))Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-28492262.post-85636536926691732852010-07-04T02:06:13.237-07:002010-07-04T02:06:13.237-07:00This is what I would use
strFilePath = "C:\U...This is what I would use<br /><br />strFilePath = "C:\Users\comp\Documents\sample.xlsx"<br />vParts = Split(strFilePath, "\")<br />sFileName = vParts(UBound(vParts))Bob Phillipsnoreply@blogger.com