Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 1783|回复: 3

求快速填充序列的方法 先谢过

[复制链接]
发表于 2012-11-12 17:28 | 显示全部楼层 |阅读模式
老师,求快速填充序列的方法  如图
A列为原始数据,按填充数列得出C列谢谢了
excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
发表于 2012-11-12 17:46 | 显示全部楼层
回复

使用道具 举报

发表于 2012-11-12 19:53 | 显示全部楼层
Sub 填充序号()
Dim rng As Range
Dim i As Integer
Dim tg As Integer
Dim x As Integer
Set rng = Range("a:a").SpecialCells(xlCellTypeConstants, 2)
If Err = 1004 Then MsgBox "当前列没有文本"
    For Each rn In rng
            If Len(rn.Value) <> 0 Then
                i = rn.Row
                tg = Left(Range("a" & i).Value, Len(Range("a" & i).Value) - 1)
                    For x = 0 To 4
                        Range("c" & i + x).Value = tg & x + 1
                    Next x
            End If
    Next rn
End Sub
回复

使用道具 举报

发表于 2012-11-13 09:30 | 显示全部楼层
录的宏改的:
Sub 宏1()
    [a1].AutoFill Destination:=Range("A1:A5")
    [a6].AutoFill Destination:=Range("A6:A10")
End Sub
还有更多可变为循环
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-4-28 01:36 , Processed in 0.995024 second(s), 12 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表