advanced help
per page, with , order by , clip by
Results of 1 - 1 of about 4265 for オートフィルタ (0.004 sec.)
[[20210902085524]]
#score: 4241
@digest: 358cb405ca19e16f9017518a1b4e4557
@id: 88867
@mdate: 2021-09-02T02:25:35Z
@size: 2227
@type: text/plain
#keywords: 外, (11983), 用de (6766), 外as (6162), 外. (6024), 目行 (5353), 用en (4655), 出範 (4519), タ解 (3825), 外= (3469), 行以 (3466), 認用 (3125), autofiltermode (3062), 除. (2996), トwi (2109), xlcelltypevisible (1591), autofilter (1516), 囲as (1380), 囲. (1291), 抽出 (1215), intersect (1211), ト型 (1170), トフ (1158), 字色 (1107), 囲= (1025), 出結 (1012), オー (989), criteria1 (961), 列目 (898), activesheet (861), ルタ (829), myrng (827), 以外 (786)
『VBAオートフィルタで抽出したデータの特定の列のみ文字色を変えたい』(ここあ)
お世話になっております。 vbaで15列目の★のマークがついた行をオートフィルタで抽出し、6列目の文字の色を赤くしたいのですがうまくいきません。 他の方の質問で行全体の色を変えるものがあり、こちらは使えたのですが、できれば6列目の文字の色だけを変えたいです。 オートフィルタの抽出結果がない場合もあり、その場合は何もせずに次の処理へ移るようにしたいです。 どなたかご教授頂けましたら幸いです。宜しくお願い致します。 Dim 項目行以外 As Range, 抽出範囲 As Range With ActiveSheet 'オートフィルタ解除 .AutoFilterMode = False 'オートフィルタを設定し抽出する .Range("A1").AutoFilter Field:=15, Criteria1:="★" 'オブジェクト型(Range型)変数にセル範囲をセット With .AutoFilter.Range Set 項目行以外 = Intersect(.Cells, .Cells.Offset(1)) Set 抽出範囲 = .SpecialCells(xlCellTypeVisible) Debug.Print 項目行以外.Address(0, 0) '確認用 Debug.Print 抽出範囲.Address(0, 0) '確認用 End With '項目行以外 かつ 抽出されている範囲(行)の文字色を赤に変更 If Not Intersect(項目行以外, 抽出範囲) Is Nothing Then Intersect(項目行以外, 抽出範囲).Font.Color = vbRed End If 'オートフィルタ解除 .AutoFilterMode = False End With < 使用 Excel:Excel2016、使用 OS:unknown > ---- こんな感じとか? Sub 始まりも終わりもないマクロ() Dim MyRNG As Range ActiveSheet.AutoFilterMode = False ActiveSheet.Range("A1").AutoFilter Field:=15, Criteria1:="★" With ActiveSheet.AutoFilter.Range On Error Resume Next Set MyRNG = Intersect(.Cells, .Cells.Offset(1).Columns(6)).SpecialCells(xlCellTypeVisible) On Error GoTo 0 If Not MyRNG Is Nothing Then MyRNG.Font.Color = vbRed End With ActiveSheet.AutoFilterMode = False End Sub (もこな2 ) 2021/09/02(木) 09:32 ---- ありがとうございます! 思い通りの結果が得られ、とても勉強になりました! (ここあ) 2021/09/02(木) 11:25 ...
http://www.excel.studio-kazu.jp/wiki/kazuwiki/202109/20210902085524.txt - [detail] - similar
PREV NEXT
Powered by Hyper Estraier 1.4.13, with 97012 documents and 608132 words.

訪問者:カウンタValid HTML 4.01 Transitional