VBA错误1004号码转换

我是一个noob,当涉及到编码…所以我有一个相当简单的代码,将原始数据作为文本格式转换为数字。 代码工作,直到我从原始数据表切换到“单独的KPI”表,所以当在单独的kpi表单上运行macros,我得到运行时错误。

Sub AccountRecon() Range("Table_ACCTDATA[[ARP Check Project, prep & formatting spreadsheets Volume]:[Review / Approve GL Reconciliations Minutes]]").Select With Selection Selection.NumberFormat = "0.0" .Value = .Value End With End Sub 

当你input

 With Something 

这意味着在…的每一行之前的Somethingwith .. end with

解决这个错误会给:

 Sub AccountRecon() Range("Table_ACCTDATA[[ARP Check Project, prep & formatting spreadsheets Volume]:[Review / Approve GL Reconciliations Minutes]]").Select With Selection .NumberFormat = "0.0" 'Removed "Selection" .Value = .Value End With End Sub