作者:乔山办公网日期:
返回目录:excel表格制作
Sub test()
Dim cel As Range
For Each cel In Range("G5:R5")
If cel.Value = 0 Then
cel.EntireColumn.Delete
End If
Next
End Sub
供参考
Sub test()
Dim myQuery
With ActiveSheet
.Cells.Delete
.[a1] = "Conneting, Please Wait..."
Set myQuery = ActiveSheet.QueryTables _
.Add(Connection:="URL;http://www.boshi.com.cn", _
Destination:=.Cells(1, 1))
End With
With myQuery
.Refresh
End With
补充:grhsc你不是知道读取全百部网页的程序吗?那度里可以先把整个网页以表格的方式读知取到excel中,建立一个道临时sheet,然后删除掉多余的数据版,或者在excel中在读取需要的权数据不就行了?
这个百VBA好操作的!
把你的度邮箱私信知给我,道把我做的发给内你!
代码容如下:
Sub AA()
For i = 1 To Sheets(2).[a65536].End(3).Row
Set m = Sheet1.Cells.Find(Sheets(2).Cells(i, 1), lookat:=xlWhole, SearchOrder:=xlByColumns)
If Not m Is Nothing Then
Sheets(2).Cells(i, 2) = m.Offset(0, 1)
End If
Next
End Sub
excel 支持不是很好,range 我没百用过 我都度是用 select * from [sheet1]
而且加上 order by 就会不稳定问
你可以试试 给答 range 加上 []
[range1].A ... from [range1]
还有,你的变量不对,版 cn cnn,rs,rst ,在代码最开头加一行
Option Explicit 强制一下会权好点