可根据具体使用情况修改“Set compareRange = wsCurrent.Range("A5:AC17")”,括号内为比较范围Option Explicit Public Sub 比较两张表格差异() ' --- 变量声明 --- Dim wsCurrent As Worksheet Dim wsPrevious As Worksheet Dim compareRange As Range Dim cell As Range Dim previousSheetName As String Dim previousCellValue As Variant Dim differencesFound As Long Dim commentText As String Set wsCurrent = Application.ActiveSheet differencesFound
因为合并单元格的不同,导致需要多重判断,异常难做,BUG很多,仅作留档备份
专为编办设计,一键将选中表格英文符号全部替换为中文符号,同时将数字格式修改为Times New Roman。
Sub 数字全部换为新罗马() Dim cell As Range Dim originalText As String Dim i As Long Dim char As String ' Loop through each selected cell For Each cell In Selection If Not IsEmpty(cell) Then originalText = cell.value If Len(originalText) > 0 Then ' Process each character in the cell For i = 1 To Len(originalText) char = Mid(originalText, i, 1) ' Check if the character is
使用前需对溯源序号进行超链接赋予操作。' 定义全局变量,记录第一次输入的工作表名称及筛选的列号 Private storedSheetName As String Private storedFilterColumn As Long ' 用户可在此处填写目标工作表名称 Private Function GetTargetSheetName() As String GetTargetSheetName = "1." ' 替换为实际工作表名称,例如 "Sheet1" 或 "基础版" End Function ' 用户可在此处填写筛选的列号 Private Function GetFilterColumn() As Long GetFilterColumn = 1 ' 替换为实际列号,例如 1 表示第一列 End Function Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink) Dim arr() As String
狗剩