我有一个带有渗压计数据的电子表格。我使用的那个更大,我们每半年左右更新一次,但这里是要点:
PZ # Water EL TIP Pool Tail
PZ-1A 888 864 910 880
PZ-1A 888 864 911 880
PZ-1A 888 864 912 880
PZ-1B 889 839 910 880
PZ-1B 889 839 911 880
PZ-1B 889 839 912 880
PZ-2 890 860 910 880
PZ-2 890 860 911 880
PZ-2 890 860 912 880
我需要为每个渗压计制作一个新的(或现有的)选项卡,例如选项卡“PZ-1A”如下所示:
PZ # Water EL TIP Pool Tail
PZ-1A 888 864 910 880
PZ-1A 888 864 911 880
PZ-1A 888 864 912 880
和标签“PZ-1B”看起来像这样
PZ # Water EL TIP Pool Tail
PZ-1B 889 839 910 880
PZ-1B 889 839 911 880
PZ-1B 889 839 912 880
和标签“PZ-2”看起来像这样
PZ # Water EL TIP Pool Tail
PZ-2 890 860 910 880
PZ-2 890 860 911 880
PZ-2 890 860 912 880
等等。我使用匹配单元尝试了几件事,但没有什么值得发布的。我知道一旦我得到了 PZ-1A 的代码,只需为其余的代码复制代码即可。这是我需要的评论形式...
Sub find()
For Each cell In Range("A")
'select all cells that match the text "PZ-1A"
'copy these entire rows to a new sheet named 'PZ-1A'
'select all cells that match the text "PZ-1B"
'copy these entire rows to a new sheet named 'PZ-1B'
'select all cells that match the text "PZ-2"
'copy these entire rows to a new sheet named 'PZ-2'
Next cell
End Sub
我自己会继续努力,但我还有很长的路要走。在学校,我学了一些 Matlab,但那是不久前的事了,现在我才刚刚开始我的 VBA 之旅。
有没有人可以使用任何有用的建议/代码?