使用MID提取string:VBA运行时错误424:对象必需

我正在使用Office 2013中的Windows 7使用Mid来提取部分string,具体取决于条件。 我得到下面的代码的运行时错误424:

RW = 1 Set c = ActiveSheet.Cells(6, 3) While Not IsEmpty(c.Offset(RW, 0).Value) c.Offset(RW, 3).Text = Mid(c.Offset(RW, 0).Text, 7, 2) ' Getting error on this line If (Mid(c.Offset(RW, 0).Text, 3, 1) = "/") Then Set c.Offset(RW, 1).Text = Mid(c.Offset(RW, 0).Text, 1, 2) Set c.Offset(RW, 2).Text = Mid(c.Offset(RW, 0).Text, 4, 2) ElseIf (Mid(c.Offset(RW, 0).Text, 3, 1) = "-") Then Set c.Offset(RW, 1).Text = Mid(c.Offset(RW, 0).Text, 4, 2) Set c.Offset(RW, 2).Text = Mid(c.Offset(RW, 0).Text, 1, 2) End If 

任何帮助吗?

Text属性是只读的。

改用Value属性。