码迷,mamicode.com
首页 > 编程语言 > 详细

[VBA]定向提取符合条件的内容

时间:2017-09-05 00:30:49      阅读:214      评论:0      收藏:0      [点我收藏+]

标签:vba   代码   分享   alt   定向   png   image   .com   ext   

要求:若A列满足值为c,则将b列对应的内容背景色调为红色,并提取出来:

技术分享

技术分享

代码如下:

Sub naqu()
Dim i As Integer
For i = 2 To Range("a65536").End(xlUp).Row

If Cells(i, 1) = "c" Then
n = n + 1
Cells(i, 2).Interior.Color = 666
Cells(n, 3) = Cells(i, 2)

End If
Next

End Sub

[VBA]定向提取符合条件的内容

标签:vba   代码   分享   alt   定向   png   image   .com   ext   

原文地址:http://www.cnblogs.com/susuye/p/7476196.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!