Workbook.open问题

时间:2019-04-26 10:30:30

标签: excel vba

你好,我试图打开一个参照单元格G13的文件,它最初工作了几次,但是在病房之后,我无法再执行代码了。

请帮助

Sub ConvertTextToNumbers()
Dim wBook As Workbook
Dim LastRow As Long, LastCol As Long
Dim Rangetemp As Range
Dim Workbook1 As Range

Set Workbook1 = Range("G13")
'Enter here the path of your workbook
Set wBook = Workbooks.Open("Workbook1")
LastRow = Cells.Find(What:="*", After:=Range("A1"), SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
LastCol = Cells.Find(What:="*", After:=Range("A1"), SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column

For c = 1 To LastCol
Set Rangetemp = Cells(c).EntireColumn
Rangetemp.TextToColumns DataType:=xlDelimited, _
    TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
    Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
    :=Array(1, 1), TrailingMinusNumbers:=True
Next c
End Sub

0 个答案:

没有答案