注册 登录
编程论坛 Excel/VBA论坛

求代码注释

古城漫步 发布于 2022-09-20 10:04, 313 次点击
哪位大神帮忙把下边这段代码加一下注释!

Public Sub updateRow()

'-----------------------------------------------------
    Dim rowCount As Long, ur
    Set ur = Application.Worksheets("变更单").UsedRange.Rows
    rowCount = ur.Count
   
    Dim dicUpdate
    Set dicUpdate = CreateObject("Scripting.Dictionary")
   
    = vbTextCompare
   
    Dim utemp(1 To 2) As Variant
   
    For Each cr In ur
        If cr.Row > 1 And cr.Row < rowCount Then
            utemp(1) = cr.Columns(8)
            utemp(2) = cr.Columns(10)
            
            dicUpdate.Item(cr.Columns(1).Value) = utemp
        End If
    Next cr
 
   
    '-------------------------------------------------
2 回复
#2
厨师王德榜2022-09-20 14:03
把当前所有行中的数据(除首尾行之外)的8列和10列,以第1列为key值. 装入一个哈希表dicUpdate.
#3
古城漫步2022-09-24 15:21
谢谢!
1