在Excel中循环遍历范围的每一行 [英] Loop through each row of a range in Excel

查看:519
本文介绍了在Excel中循环遍历范围的每一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我确信有一个内置函数之一(而且我以前可能已经被告知了),但是我正在抓住我的头脑记住它。

This is one of those things that I'm sure there's a built-in function for (and I may well have been told it in the past), but I'm scratching my head to remember it.

如何使用Excel VBA循环遍历多列范围的每一行?我一直在搜索的所有教程似乎只提到通过一维范围工作...

How do I loop through each row of a multi-column range using Excel VBA? All the tutorials I've been searching up seem only to mention working through a one-dimensional range...

推荐答案

Dim a As Range, b As Range

Set a = Selection

For Each b In a.Rows
    MsgBox b.Address
Next

这篇关于在Excel中循环遍历范围的每一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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