墨羽的个人空间 https://blog1.eetop.cn/?1717102 [收藏] [复制] [分享] [RSS]

日志

Excel批量建sheet的宏命令

已有 740 次阅读| 2023-5-15 11:51 |系统分类:其他

批量将表格数据对应建立超链接的宏命令。


Sub NewSht()

Dim shtActive As Worksheet, sht As Worksheet

Dim i As Long, strShtName As String

On Error Resume Next

Set shtActive Activesheet

For i= 2 To shtActive. Cells(Rows.Count, 1).End(xlUp).Row

strShtName shtActive. Cells(i, 1).Value

Set sht Sheets(strShtName)

If Err Then

Worksheets.Add, Sheets(Sheets. Count)

ActiveSheet. Name strShtName

Err.Clear

End If

Next

shtActive.Activate

End Sub


点赞

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 注册

  • 0

    周排名
  • 0

    月排名
  • 0

    总排名
  • 0

    关注
  • 1

    粉丝
  • 0

    好友
  • 0

    获赞
  • 0

    评论
  • 8

    访问数

手机版| 小黑屋| 关于我们| 联系我们| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2025-5-25 06:37 , Processed in 0.122650 second(s), 13 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
返回顶部