如何从文件名(VBA)中删除文件扩展名 [英] How to remove file extension from file name (VBA)
本文介绍了如何从文件名(VBA)中删除文件扩展名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个文件名变量,它包含:Filename.csv
。要从我使用的路径中提取文件名: Filename = Dir([fStr])
其中 fStr
我选择的文件。
I have a filename variable that contains : "Filename.csv"
. To extract the filename from a path I use: Filename=Dir([fStr])
where fStr
is retrieved from the file that I selected.
我只需要没有csv
的文件名。如何删除csv
扩展名?
I only need the filename without ".csv"
. How do I remove the ".csv"
extension?
推荐答案
您可以使用替换功能:
Filename = replace(Dir([fStr]),".csv","")
这篇关于如何从文件名(VBA)中删除文件扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文