代码拉取完成,页面将自动刷新
同步操作将从 泡泡时空/VBA-Library 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Attribute VB_Name = "ExcelUtils"
'========================================================================'
'== EXCELUTILS =='
'== =='
'== © Copyright 2018 Rudi Breedenraedt - rudi@breedenraedt.be =='
'========================================================================'
Option Explicit
'------------------------------------------------------------------------'
'Function FirstColumnOf : returns the first column of the given range. '
'------------------------------------------------------------------------'
Function FirstColumnOf(ByVal r As Range) As Range
Set FirstColumnOf = r.Columns(1)
End Function
'------------------------------------------------------------------------'
'Function FirstRowOf : returns the first row of the given range. '
'------------------------------------------------------------------------'
Function FirstRowOf(ByVal r As Range) As Range
Set FirstRowOf = r.Rows(1)
End Function
'------------------------------------------------------------------------'
'Function LastColumnOf : returns the last column of the given range. '
'------------------------------------------------------------------------'
Function LastColumnOf(ByVal r As Range) As Range
Set LastColumnOf = r.Columns(r.Columns.Count)
End Function
'------------------------------------------------------------------------'
'Function LastRowOf : returns the last row of the given range. '
'------------------------------------------------------------------------'
Function LastRowOf(ByVal r As Range) As Range
Set LastRowOf = r.Rows(r.Rows.Count)
End Function
'------------------------------------------------------------------------'
'Function BSearchRow : binary search for row by value. '
' ws : worksheet to search '
' startrow : rownumber to start searching '
' endrow : rownumber to end searching '
' forValue : value to search for '
' inColumn : index of the column to search for the value '
'Returns the row index where the value was found, or 0 if not found. '
'Note that the values must appear in sorted order in the table for binary'
'search to work.
'------------------------------------------------------------------------'
Function BSearchRow(ByVal ws As Worksheet, ByVal startrow As Integer, ByVal endrow As Integer, ByVal forValue As Variant, ByVal inColumn As Integer) As Integer
Dim r As Range
Dim rindex As Integer
Do
rindex = (startrow + endrow) / 2
Set r = ws.Cells(rindex, columnindex)
If r.value = value Then
BSearchRow = rindex
Exit Function
ElseIf r.value < value Then
startrow = rindex + 1
Else
endrow = rindex - 1
End If
If startrow > endrow Then Exit Function
Loop
End Function
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。