|
楼主 |
发表于 2023-3-7 16:00
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
各位老师源代码是:
Sub 定位()
Dim y2%, y1%, m%, n%, x As Long, 定位 As Byte
定位 = [C1]
Worksheets("Sheet3").Range("C5:R20") = ""
Application.ScreenUpdating = False
x = Worksheets("Sheet1").Range("A1").Value
For ia = 1 To 16
For i = 4 To x - 1
y1 = Worksheets("Sheet1").Range("F" & i).Value '怎么修改动态定位指定列
y2 = Worksheets("Sheet1").Range("F" & (i + 1)).Value '怎么修改动态定位指定列
If y1 = ia Then
n = 4 + Application.WorksheetFunction.Match(y1, Worksheets("Sheet3").Range(Worksheets("Sheet3").Cells(5, 2), Worksheets("Sheet3").Cells(20, 2)))
m = 2 + Application.WorksheetFunction.Match(y2, Worksheets("Sheet3").Range(Worksheets("Sheet3").Cells(3, 3), Worksheets("Sheet3").Cells(3, 18)))
Worksheets("Sheet3").Cells(n, m).Value = Worksheets("Sheet3").Cells(n, m).Value + 1
End If
Next i
Next ia
Application.ScreenUpdating = True
End Sub
|
|