Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 4 个不同的宏。我需要知道是否有一种方法可以在主表上运行一个宏,如果 D 列有 16 个值并且只有 4 个是唯一值,它应该循环遍历这 4 个值并运行与该值关联的宏。需要尽快解决这个问题!
请帮忙!
就像是:
Sub sistence() Dim rD As Range Set rD = Range("D1:D100") For Each r In rD v = r.Value If v = "A" Then Call MacroA If v = "B" Then Call MacroB If v = "C" Then Call MacroC If v = "D" Then Call MacroD Next r End Sub