[英]VBA function to find cell value within range
Beginner vba user. 初学者vba用户。
I'm trying to create a function that will allocate the correct client_id
in cell C2:C6
, using the House
and the Date
values. 我正在尝试创建一个函数,该函数使用House
和Date
值在单元格C2:C6
分配正确的client_id
。
One House
could have had multiple client_ids
over time, so I need to allocate the correct client_id
based on the Joining Date
. 一所House
随着时间的流逝可能会有多个client_ids
,因此我需要根据Joining Date
分配正确的client_id
。
The function needs to find all instances where the House
value is the same in the range A9:C13
. 函数需要查找House
值在A9:C13
范围内相同的所有实例。
Below is the desired outcome: 以下是理想的结果:
The first step is setting the range, and then looping through this range for column B
to find all instances where the house number matched the value in this column. 第一步是设置范围,然后在B
列中遍历该范围,以查找门牌号与该列中的值匹配的所有实例。
If I set the known range: 如果我设定已知范围:
Dim rng As Range: Set rng = Application.Range("Data!A10:C13")
How do I loop over this range for column B
? 如何在B
列的此范围内循环?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.