EXCEL VBA 又来请教了,谢谢大家!
答案:2 悬赏:40 手机版
解决时间 2021-04-20 12:14
- 提问者网友:你给我的爱
- 2021-04-19 14:28
EXCEL VBA 又来请教了,谢谢大家!
最佳答案
- 五星知识达人网友:由着我着迷
- 2021-04-19 14:39
试试行不行:
Option Explicit
Sub 序号()
Dim rng As Range, i%, k%, r%, st As String
k = 1
For Each rng In Selection
r = rng.Row
If Rows(r & ":" & r).Hidden = False Then
st = st & rng.Offset(, -1) & "/" & k
k = k + 1
End If
Next
With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
.SetText st
.PutInClipboard
End With
End Sub
Option Explicit
Sub 序号()
Dim rng As Range, i%, k%, r%, st As String
k = 1
For Each rng In Selection
r = rng.Row
If Rows(r & ":" & r).Hidden = False Then
st = st & rng.Offset(, -1) & "/" & k
k = k + 1
End If
Next
With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
.SetText st
.PutInClipboard
End With
End Sub
全部回答
- 1楼网友:时间的尘埃
- 2021-04-19 15:03
Sub 序号()
Dim rng As Range, i%, k%, r%, st As String
k = 1
For Each rng In Selection
r = rng.Row
If Rows(r & ":" & r).Hidden = False Then
st = st & Chr(10) & rng.Offset(, -1) & "/" & k
k = k + 1
End If
Next
With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
.SetText st
.PutInClipboard
End With
End Sub
Dim rng As Range, i%, k%, r%, st As String
k = 1
For Each rng In Selection
r = rng.Row
If Rows(r & ":" & r).Hidden = False Then
st = st & Chr(10) & rng.Offset(, -1) & "/" & k
k = k + 1
End If
Next
With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
.SetText st
.PutInClipboard
End With
End Sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯