1
举例来说,如果我有:如何从VBA(Excel)中的字符串中提取第一个单词?
Sub TestModule()
Dim test As String
test = "Machine Head"
End Sub
我将如何提取字机,并将其分配给一个变量? 我曾尝试使用搜索和左功能,但没有太多成功。
干杯!
举例来说,如果我有:如何从VBA(Excel)中的字符串中提取第一个单词?
Sub TestModule()
Dim test As String
test = "Machine Head"
End Sub
我将如何提取字机,并将其分配给一个变量? 我曾尝试使用搜索和左功能,但没有太多成功。
干杯!
采用分体式():
Sub TestModule()
Dim test As String
dim frstWrd as string
test = "Machine Head"
frstWrd = split(test," ")(0)
Debug.Print frstWrd
End Sub
非常感谢! :D –
@MattHill不要忘记通过点击选中标记来标记为正确。 –