在Excel VBA中找到给定行号之后的第一个空行 [英] Find the first empty row after the given row number in Excel VBA

查看:94
本文介绍了在Excel VBA中找到给定行号之后的第一个空行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要找到给定行号之后的第一个空行号.

I need to find the first empty row number after the given row number.

请检查下面的图片

例如:假设我当前的行号是6,那么我的输出应该是10.

for e.g: assume, my current row number is 6 then my output should be 10.

推荐答案

我使用CountA来查看整行是否为空.

I use CountA to see if the entire row is empty.

   Function FirstEmtpyRow(startRow As Long) As Long

        Do
            startRow = startRow + 1
            If startRow = rpws.Count Then Exit Function

        Loop Until WorksheetFunction.CountA(Rows(startRow)) = 0

        FirstEmtpyRow = startRow

    End Function

这篇关于在Excel VBA中找到给定行号之后的第一个空行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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