gpt4 book ai didi

Excel VBA : To fill or replace blank value fast

转载 作者:行者123 更新时间:2023-12-04 21:30:41 24 4
gpt4 key购买 nike

需要您的帮助来获得相同的目标,以比下面的脚本更快地填充“null”值。

Sub FillEmptyCell()
Dim rng As Range
Dim i As Long
Dim cell As Range
Dim sht As Worksheet
Set sht = ActiveWorkbook.Sheets("rawdata")
sht.Activate
Set rng = Range(Range("G2:G14614"), Range("G" & sht.UsedRange.Rows.Count))
For Each cell In rng
If cell.Value = "" Then cell.Value = "BLANKON"
Next
End Sub

最佳答案

尝试,

Sub FillEmptyCell()
with workSheets("rawdata")
with .range(.cells(2, "G"), .cells(.rows.count, "G").end(xlup))
on error resume next
.specialcells(xlcelltypeblanks) = "BLANKON"
on error goto 0
end with
.Activate
end with
End Sub

关于Excel VBA : To fill or replace blank value fast,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52886028/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com