X +++ .. Y ++ .. Z +的Excel自动填充列 [英] Excel auto fill column by X+++..Y++..Z+

查看:109
本文介绍了X +++ .. Y ++ .. Z +的Excel自动填充列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何自动填充两者之间的值?

How do I autofill the values in between?

推荐答案

使用此VBA

Sub FillValues()
    Dim c As Range
    For Each c In Range("A1:A" & Range("B" & Rows.Count).End(xlUp).Row)
        If IsEmpty(c) Then c = c.Offset(-1, 0)
    Next c
End Sub

ALT + F11 打开VBE,然后右键单击Project Explorer( CTRL + R )

Insert» Module

然后将 ALT + F8 转换为View Macros»选择 FillValues

hit ALT+F11 to open VBE, then right click in the Project Explorer (CTRL+R)

and Insert » Module

then ALT+F8 to View Macros » select FillValues

获得

使用

Sub FillValues()
    Dim c As Range
    For Each c In Range("A1:A" & Range("B" & Rows.Count).End(xlUp).Row)
        If IsEmpty(c) Then c = c.Offset(-1, 0) +1
    Next c
End Sub

这篇关于X +++ .. Y ++ .. Z +的Excel自动填充列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆