6
在JAVA或C++中,我们可以沿着myString.insert(position, word)
的方向执行一些操作。有没有办法在Excel VBA的字符串中做同样的事情?在我的工作表中,我有一个如下所示的字符串:01/01/995
,我想在年份中插入1,因此请将其设为01/01/1995
。插入到Excel VBA字符串中
Dim test_date As String
test_date = "01/25/995"
test_date = Mid(test_date, 1, 10) & "1" & Mid(test_date, 11, 4)
有没有另一种更简单/更优雅的方式来做到这一点?
使用'中秋节$''不Mid',前者是一个字符串函数,后来的一个变体功能。字符串函数更快 – brettdj