|
gwfzh 发表于 2011-9-29 13:51
回复 爱疯 的帖子
谢谢爱疯 老师:程序Sub a()出现运行错误"1004":此操作要求合并单元格都具有相同大小,不 ...
是我的疏忽,被排序单元格区域存在合并单元格,所以提示。b()不会有这提示了。
- Sub b()
- Dim x As Long, y As Long
-
- Cells.Delete
- With ActiveSheet.QueryTables.Add( _
- Connection:="URL;http://datachart.500wan.com/ssq/history/inc/history.php", _
- Destination:=Range("A65000").End(xlUp).Offset(1, 0))
- .Refresh BackgroundQuery:=False
- End With
-
- x = Range("A65000").End(xlUp).End(xlUp).Row
- y = Range("A65000").End(xlUp).Row
- Range(Cells(x, "A"), Cells(y, "P")).Sort _
- Key1:=Range("B3"), Order1:=xlAscending, Header:=xlGuess
- End Sub
复制代码
|
|