mpjx.net
当前位置:首页 >> EXCEL VBA按颜色提取内容和颜色 >>

EXCEL VBA按颜色提取内容和颜色

程序如下: Sub 宏()Dim i As Integer, j As Integer, k As IntegerFor i = 4 To 41 k = Cells(Rows.Count, i).End(xlUp...

Public C '定义全局变量CPrivate Sub Worksheet_SelectionChange(ByVal Target As Range)On Error Resume Next Dim one...

这里只序号10行10列,代码只参考啊 Sub test() Dim i As Long, j As Integer, max As Double max = Val(Cells(1, 1)) '...

Sub s() Set rg1 = [K14:T23] Set rg2 = [V3:w13] Set t = [m1:q1] x = 1 y = 1 For i = 1 To 5 cl = t(i).Interior.Color kk = "" For j = 1 To rg1.Columns.Count For k = 1 To rg1.Rows.Count If rg1.Cells(k, j).Interior.Color = cl Then I...

Sub s() Set rg1 = [K14:T23] Set rg2 = [V3:w13] Set t = [l1:p1] x = 1 y = 1 For i = 1 To 5 cl = t(i).Interior.Color kk = "" For j = 1 To rg1.Columns.Count For k = 1 To rg1.Rows.Count If rg1.Cells(k, j).Interior.Color = cl Then I...

举例说明。 例如有表格如图: 要求将黄色的内容放到另一表格中。 第一步:在当前工作表中编制代码如下: Dim myRang As StringDim mySheeti = Range("B65536").End(xlUp).Row '记录最后行号myRang = "a1:b" & Trim(Str(i))myArr1 = Range(myRang...

Cells(1, 1).Font.ColorIndex = 3 '字的颜色号为3 红色 Cells(1, 1).Interior.ColorIndex = 3 ' 背景的颜色为3 红色 Cells(2, 1).Font.Color = RGB(0, 255, 0) '字的颜色绿色 Cells(2, 1).Interior.Color = RGB(0, 0, 255) '背景的颜色蓝色

Sub xx() Const t = 2 a = String(t, "X") With Sheets("sheet1") For i = 5 To 10 k = 13 For j = 8 To 16 If .Cells(j, i).Interior.ColorIndex = xlNone Then Sheets("sheet2").Cells(k, i + 5) = a & .Cells(j, i) k = k + 1 End If Next Ne...

Sub s() n = 6 With Sheets("问13表结果") While (.Cells(n, 3) "") n = n + 1 Wend k = Sheets("问13表").Cells(Rows.Count, 3).End(3).Row For i = 3 To 9 .Cells(n, 3) = .Cells(n, 3) & Sheets("问13表").Cells(k, i) Next .Cells(n, 3).Cha...

r = ColorInfo Mod 256 g = (ColorInfo - r) / 256 Mod 256 b = (ColorInfo - r - g * 256) / 256 ^ 2 Color=RGB(R, G, B) 用位运算分离RGB: R = Color And &HFF G = (Color And &HFF00&) \ &H100 B = (Color And &HFF0000) \ &H10000 是不是...

网站首页 | 网站地图
All rights reserved Powered by www.mpjx.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com