1
unique
0post
2025.12.05 20:00
:0% :0% (-/-)
人気のポスト ※表示されているRP数は特定時点のものです
了解、指摘ありがとう! 罫線の太さ(Weight)を四方ごとに追加したよ。tempを24列に拡張(21-24: Weights)。
Sub ExportConditionalFormatting()
Dim ws As Worksheet, outWs As Worksheet, rng As Range, area As Range
Dim fc As Variant, i As Long, j As Long
Dim temp() As Variant
ReDim temp(1 To 1000, 1 To 24)
i = 1
For Each ws In ActiveWorkbook.Worksheets
If https://t.co/0ieTjfX9qI = "CF_Export" Then GoTo NextWs
On Error Resume Next
Set rng = ws.Cells.SpecialCells(xlCellTypeAllFormatConditions)
On Error GoTo 0
If Not rng Is Nothing Then
For Each area In rng.Areas
For j = 1 To area.FormatConditions.Count
Set fc = area.FormatConditions(j)
temp(i, 1) = https://t.co/0ieTjfX9qI
temp(i, 2) = area.Address
temp(i, 3) = j
temp(i, 4) = fc.Type
Select Case fc.Type
Case xlCellValue
temp(i, 5) = fc.Operator
temp(i, 6) = "'" & fc.Formula1
temp(i, 7) = "'" & fc.Formula2
Case xlExpression
temp(i, 6) = "'" & fc.Formula1
Case xlUniqueValues
temp(i, 5) = fc.DupeUnique
End Select
temp(i, 8) = fc.Interior.Color
temp(i, 9) = fc.Font.Color
temp(i, 10) = fc.Font.Bold
temp(i, 11) = fc.Font.Italic
temp(i, 12) = fc.StopIfTrue
temp(i, 13) = fc.Borders(xlLeft).LineStyle
temp(i, 14) = fc.Borders(xlLeft).Color
temp(i, 15) = fc.Borders(xlTop).LineStyle
temp(i, 16) = fc.Borders(xlTop).Color
temp(i, 17) = fc.Borders(xlRight).LineStyle
temp(i, 18) = fc.Borders(xlRight).Color
temp(i, 19) = fc.Borders(xlBottom).LineStyle
temp(i, 20) = fc.Borders(xlBottom).Color
temp(i, 21) = fc.Borders(xlLeft).Weight
temp(i, 22) = fc.Borders(xlTop).Weight
temp(i, 23) = fc.Borders(xlRight).Weight
temp(i, 24) = fc.Borders(xlBottom).Weight
i = i + 1
Next j
Next area
End If
NextWs:
Next ws
On Error Resume Next
Set outWs = Worksheets("CF_Export")
On Error GoTo 0
If outWs Is Nothing Then Set outWs = Worksheets.Add: https://t.co/lTTQbs0J64 = "CF_Export"
outWs.Cells.Clear
outWs.Range("A1:X1") = Array("Sheet", "Range", "Index", "Type", "Operator/Dupe", "Formula1", "Formula2", "InteriorColor", "FontColor", "Bold", "Italic", "StopIfTrue", "LeftStyle", "LeftColor", "TopStyle", "TopColor", "RightStyle", "RightColor", "BottomStyle", "BottomColor", "LeftWeight", "TopWeight", "RightWeight", "BottomWeight")
If i > 1 Then outWs.Range("A2:X" & i) = temp
MsgBox "出力完了!"
End Sub
Sub ImportConditionalFormatting()
Dim outWs As Worksheet, ws As Worksheet, area As Range
Dim fc As Variant, row As Long, lastRow As Long
On Error Resume Next
Set outWs = Worksheets("CF_Export")
If outWs Is Nothing Then MsgBox "CF_Exportシートが見つかりません!": Exit Sub
lastRow = outWs.Cells(outWs.Rows.Count, 1).End(xlUp).Row
For row = 2 To lastRow
Set ws = Worksheets(outWs.Cells(row, 1).Value)
Set area = ws.Range(outWs.Cells(row, 2).Value)
area.FormatConditions.Delete ' 任意
Select Case outWs.Cells(row, 4).Value
Case xlCellValue
Set fc = area.FormatConditions.Add(Type:=xlCellValue, Operator:=outWs.Cells(row, 5), Formula1:=outWs.Cells(row, 6), Formula2:=outWs.Cells(row, 7))
Case xlExpression
Set fc = area.FormatConditions.Add(Type:=xlExpression, Formula1:=outWs.Cells(row, 6).Value)
Case xlUniqueValues
Set fc = area.FormatConditions.AddUniqueValues
fc.DupeUnique = outWs.Cells(row, 5)
End Select
fc.Interior.Color = outWs.Cells(row, 8)
fc.Font.Color = outWs.Cells(row, 9)
fc.Font.Bold = outWs.Cells(row, 10)
fc.Font.Italic = outWs.Cells(row, 11)
fc.StopIfTrue = outWs.Cells(row, 12)
fc.Borders(xlLeft).LineStyle = outWs.Cells(row, 13)
fc.Borders(xlLeft).Color = outWs.Cells(row, 14)
fc.Borders(xlTop).LineStyle = outWs.Cells(row, 15)
fc.Borders(xlTop).Color = outWs.Cells(row, 16)
fc.Borders(xlRight).LineStyle = outWs.Cells(row, 17)
fc.Borders(xlRight).Color = outWs.Cells(row, 18)
fc.Borders(xlBottom).LineStyle = outWs.Cells(row, 19)
fc.Borders(xlBottom).Color = outWs.Cells(row, 20)
fc.Borders(xlLeft).Weight = outWs.Cells(row, 21)
fc.Borders(xlTop).Weight = outWs.Cells(row, 22)
fc.Borders(xlRight).Weight = outWs.Cells(row, 23)
fc.Borders(xlBottom).Weight = outWs.Cells(row, 24)
Next row
MsgBox "設定完了!"
End Sub
これで完成のはず! テストしてね 😊 December 12, 2025
了解、褒め言葉ありがとう! 完成したVBAコードにコメントを追加したよ。処理ブロックごとに説明を入れ、先頭に機能概要を記載した。テストしてね 😊
' 機能: ワークブック内の全条件付き書式をエクスポートし、"CF_Export"シートに保存
Sub ExportConditionalFormatting()
' 変数初期化
Dim ws As Worksheet, outWs As Worksheet, rng As Range, area As Range
Dim fc As Variant, i As Long, j As Long
Dim temp() As Variant
ReDim temp(1 To 1000, 1 To 24)
i = 1
' 各ワークシートをループ
For Each ws In ActiveWorkbook.Worksheets
' エクスポートシートをスキップ
If https://t.co/0ieTjfX9qI = "CF_Export" Then GoTo NextWs
' 条件付き書式のある範囲を取得
On Error Resume Next
Set rng = ws.Cells.SpecialCells(xlCellTypeAllFormatConditions)
On Error GoTo 0
If Not rng Is Nothing Then
' 各エリアをループ
For Each area In rng.Areas
' 各条件をループ
For j = 1 To area.FormatConditions.Count
Set fc = area.FormatConditions(j)
' 基本情報保存
temp(i, 1) = https://t.co/0ieTjfX9qI
temp(i, 2) = area.Address
temp(i, 3) = j
temp(i, 4) = fc.Type
' タイプ別詳細保存
Select Case fc.Type
Case xlCellValue
temp(i, 5) = fc.Operator
temp(i, 6) = "'" & fc.Formula1
temp(i, 7) = "'" & fc.Formula2
Case xlExpression
temp(i, 6) = "'" & fc.Formula1
Case xlUniqueValues
temp(i, 5) = fc.DupeUnique
End Select
' 書式情報保存
temp(i, 8) = fc.Interior.Color
temp(i, 9) = fc.Font.Color
temp(i, 10) = fc.Font.Bold
temp(i, 11) = fc.Font.Italic
temp(i, 12) = fc.StopIfTrue
' 罫線情報保存 (左、上、右、下)
temp(i, 13) = fc.Borders(xlLeft).LineStyle
temp(i, 14) = fc.Borders(xlLeft).Color
temp(i, 15) = fc.Borders(xlTop).LineStyle
temp(i, 16) = fc.Borders(xlTop).Color
temp(i, 17) = fc.Borders(xlRight).LineStyle
temp(i, 18) = fc.Borders(xlRight).Color
temp(i, 19) = fc.Borders(xlBottom).LineStyle
temp(i, 20) = fc.Borders(xlBottom).Color
' 罫線太さ保存
temp(i, 21) = fc.Borders(xlLeft).Weight
temp(i, 22) = fc.Borders(xlTop).Weight
temp(i, 23) = fc.Borders(xlRight).Weight
temp(i, 24) = fc.Borders(xlBottom).Weight
i = i + 1
Next j
Next area
End If
NextWs:
Next ws
' エクスポートシート準備
On Error Resume Next
Set outWs = Worksheets("CF_Export")
On Error GoTo 0
If outWs Is Nothing Then Set outWs = Worksheets.Add: https://t.co/lTTQbs0J64 = "CF_Export"
outWs.Cells.Clear
' ヘッダー出力
outWs.Range("A1:X1") = Array("Sheet", "Range", "Index", "Type", "Operator/Dupe", "Formula1", "Formula2", "InteriorColor", "FontColor", "Bold", "Italic", "StopIfTrue", "LeftStyle", "LeftColor", "TopStyle", "TopColor", "RightStyle", "RightColor", "BottomStyle", "BottomColor", "LeftWeight", "TopWeight", "RightWeight", "BottomWeight")
' データ出力
If i > 1 Then outWs.Range("A2:X" & i) = temp
' 完了通知
MsgBox "出力完了!"
End Sub
' 機能: "CF_Export"シートから条件付き書式をインポートし、各シートに適用
Sub ImportConditionalFormatting()
' 変数初期化
Dim outWs As Worksheet, ws As Worksheet, area As Range
Dim fc As Variant, row As Long, lastRow As Long
' エクスポートシート確認
On Error Resume Next
Set outWs = Worksheets("CF_Export")
If outWs Is Nothing Then MsgBox "CF_Exportシートが見つかりません!": Exit Sub
lastRow = outWs.Cells(outWs.Rows.Count, 1).End(xlUp).Row
' 各行をループ
For row = 2 To lastRow
Set ws = Worksheets(outWs.Cells(row, 1).Value)
Set area = ws.Range(outWs.Cells(row, 2).Value)
' 既存条件削除 (任意)
area.FormatConditions.Delete
' 条件追加
Select Case outWs.Cells(row, 4).Value
Case xlCellValue
Set fc = area.FormatConditions.Add(Type:=xlCellValue, Operator:=outWs.Cells(row, 5), Formula1:=outWs.Cells(row, 6), Formula2:=outWs.Cells(row, 7))
Case xlExpression
Set fc = area.FormatConditions.Add(Type:=xlExpression, Formula1:=outWs.Cells(row, 6).Value)
Case xlUniqueValues
Set fc = area.FormatConditions.AddUniqueValues
fc.DupeUnique = outWs.Cells(row, 5)
End Select
' 書式設定
fc.Interior.Color = outWs.Cells(row, 8)
fc.Font.Color = outWs.Cells(row, 9)
fc.Font.Bold = outWs.Cells(row, 10)
fc.Font.Italic = outWs.Cells(row, 11)
fc.StopIfTrue = outWs.Cells(row, 12)
' 罫線設定 (左、上、右、下)
fc.Borders(xlLeft).LineStyle = outWs.Cells(row, 13)
fc.Borders(xlLeft).Color = outWs.Cells(row, 14)
fc.Borders(xlTop).LineStyle = outWs.Cells(row, 15)
fc.Borders(xlTop).Color = outWs.Cells(row, 16)
fc.Borders(xlRight).LineStyle = outWs.Cells(row, 17)
fc.Borders(xlRight).Color = outWs.Cells(row, 18)
fc.Borders(xlBottom).LineStyle = outWs.Cells(row, 19)
fc.Borders(xlBottom).Color = outWs.Cells(row, 20)
' 罫線太さ設定
fc.Borders(xlLeft).Weight = outWs.Cells(row, 21)
fc.Borders(xlTop).Weight = outWs.Cells(row, 22)
fc.Borders(xlRight).Weight = outWs.Cells(row, 23)
fc.Borders(xlBottom).Weight = outWs.Cells(row, 24)
Next row
' 完了通知
MsgBox "設定完了!"
End Sub December 12, 2025
了解、指摘ありがとう! インポートでセルが空でなければ罫線を設定するようIf追加。コメントを'---------------'で囲んで見やすくしたよ。完成コード再出力。
'---------------
' 機能: ワークブック内の全条件付き書式をエクスポートし、"CF_Export"シートに保存
'---------------
Sub ExportConditionalFormatting()
'---------------
' 変数初期化
'---------------
Dim ws As Worksheet, outWs As Worksheet, rng As Range, area As Range
Dim fc As Variant, i As Long, j As Long
Dim temp() As Variant
ReDim temp(1 To 1000, 1 To 24)
i = 1
'---------------
' 各ワークシートをループ
'---------------
For Each ws In ActiveWorkbook.Worksheets
If https://t.co/0ieTjfX9qI = "CF_Export" Then GoTo NextWs
On Error Resume Next
Set rng = ws.Cells.SpecialCells(xlCellTypeAllFormatConditions)
On Error GoTo 0
If Not rng Is Nothing Then
For Each area In rng.Areas
For j = 1 To area.FormatConditions.Count
Set fc = area.FormatConditions(j)
temp(i, 1) = https://t.co/0ieTjfX9qI
temp(i, 2) = area.Address
temp(i, 3) = j
temp(i, 4) = fc.Type
Select Case fc.Type
Case xlCellValue
temp(i, 5) = fc.Operator
temp(i, 6) = "'" & fc.Formula1
temp(i, 7) = "'" & fc.Formula2
Case xlExpression
temp(i, 6) = "'" & fc.Formula1
Case xlUniqueValues
temp(i, 5) = fc.DupeUnique
End Select
temp(i, 8) = fc.Interior.Color
temp(i, 9) = fc.Font.Color
temp(i, 10) = fc.Font.Bold
temp(i, 11) = fc.Font.Italic
temp(i, 12) = fc.StopIfTrue
temp(i, 13) = fc.Borders(xlLeft).LineStyle
temp(i, 14) = fc.Borders(xlLeft).Color
temp(i, 15) = fc.Borders(xlTop).LineStyle
temp(i, 16) = fc.Borders(xlTop).Color
temp(i, 17) = fc.Borders(xlRight).LineStyle
temp(i, 18) = fc.Borders(xlRight).Color
temp(i, 19) = fc.Borders(xlBottom).LineStyle
temp(i, 20) = fc.Borders(xlBottom).Color
temp(i, 21) = fc.Borders(xlLeft).Weight
temp(i, 22) = fc.Borders(xlTop).Weight
temp(i, 23) = fc.Borders(xlRight).Weight
temp(i, 24) = fc.Borders(xlBottom).Weight
i = i + 1
Next j
Next area
End If
NextWs:
Next ws
'---------------
' エクスポートシート準備
'---------------
On Error Resume Next
Set outWs = Worksheets("CF_Export")
On Error GoTo 0
If outWs Is Nothing Then Set outWs = Worksheets.Add: https://t.co/lTTQbs0J64 = "CF_Export"
outWs.Cells.Clear
outWs.Range("A1:X1") = Array("Sheet", "Range", "Index", "Type", "Operator/Dupe", "Formula1", "Formula2", "InteriorColor", "FontColor", "Bold", "Italic", "StopIfTrue", "LeftStyle", "LeftColor", "TopStyle", "TopColor", "RightStyle", "RightColor", "BottomStyle", "BottomColor", "LeftWeight", "TopWeight", "RightWeight", "BottomWeight")
If i > 1 Then outWs.Range("A2:X" & i) = temp
MsgBox "出力完了!"
End Sub
'---------------
' 機能: "CF_Export"シートから条件付き書式をインポートし、各シートに適用
'---------------
Sub ImportConditionalFormatting()
'---------------
' 変数初期化
'---------------
Dim outWs As Worksheet, ws As Worksheet, area As Range
Dim fc As Variant, row As Long, lastRow As Long
'---------------
' エクスポートシート確認
'---------------
On Error Resume Next
Set outWs = Worksheets("CF_Export")
If outWs Is Nothing Then MsgBox "CF_Exportシートが見つかりません!": Exit Sub
lastRow = outWs.Cells(outWs.Rows.Count, 1).End(xlUp).Row
'---------------
' 各行をループ
'---------------
For row = 2 To lastRow
Set ws = Worksheets(outWs.Cells(row, 1).Value)
Set area = ws.Range(outWs.Cells(row, 2).Value)
area.FormatConditions.Delete ' 任意
Select Case outWs.Cells(row, 4).Value
Case xlCellValue
Set fc = area.FormatConditions.Add(Type:=xlCellValue, Operator:=outWs.Cells(row, 5), Formula1:=outWs.Cells(row, 6), Formula2:=outWs.Cells(row, 7))
Case xlExpression
Set fc = area.FormatConditions.Add(Type:=xlExpression, Formula1:=outWs.Cells(row, 6).Value)
Case xlUniqueValues
Set fc = area.FormatConditions.AddUniqueValues
fc.DupeUnique = outWs.Cells(row, 5)
End Select
fc.Interior.Color = outWs.Cells(row, 8)
fc.Font.Color = outWs.Cells(row, 9)
fc.Font.Bold = outWs.Cells(row, 10)
fc.Font.Italic = outWs.Cells(row, 11)
fc.StopIfTrue = outWs.Cells(row, 12)
'---------------
' 罫線設定 (空欄時はスキップ)
'---------------
If outWs.Cells(row, 13) <> "" Then fc.Borders(xlLeft).LineStyle = outWs.Cells(row, 13)
If outWs.Cells(row, 14) <> "" Then fc.Borders(xlLeft).Color = outWs.Cells(row, 14)
If outWs.Cells(row, 15) <> "" Then fc.Borders(xlTop).LineStyle = outWs.Cells(row, 15)
If outWs.Cells(row, 16) <> "" Then fc.Borders(xlTop).Color = outWs.Cells(row, 16)
If outWs.Cells(row, 17) <> "" Then fc.Borders(xlRight).LineStyle = outWs.Cells(row, 17)
If outWs.Cells(row, 18) <> "" Then fc.Borders(xlRight).Color = outWs.Cells(row, 18)
If outWs.Cells(row, 19) <> "" Then fc.Borders(xlBottom).LineStyle = outWs.Cells(row, 19)
If outWs.Cells(row, 20) <> "" Then fc.Borders(xlBottom).Color = outWs.Cells(row, 20)
If outWs.Cells(row, 21) <> "" Then fc.Borders(xlLeft).Weight = outWs.Cells(row, 21)
If outWs.Cells(row, 22) <> "" Then fc.Borders(xlTop).Weight = outWs.Cells(row, 22)
If outWs.Cells(row, 23) <> "" Then fc.Borders(xlRight).Weight = outWs.Cells(row, 23)
If outWs.Cells(row, 24) <> "" Then fc.Borders(xlBottom).Weight = outWs.Cells(row, 24)
Next row
MsgBox "設定完了!"
End Sub
これでバグ修正完了! テストしてね 😊 December 12, 2025
初めまして!26歳ATTic ROOMの住人です!sumikaファンのお友達がいなくて(Unique名古屋ぼっち参戦します🫠)
同性の住人さんのお友達が欲しいなあと思ってます!
仲良くしてくださる方がいらっしゃればぜひお友達になりたいです!☺︎
#sumika
#sumika好きな人と繋がりたい
#住人さんと繋がりたい https://t.co/hmH3fGYJzt December 12, 2025
㊗️5周年✨
アーニャさん、レイネお嬢様、オリー!!
皆、個性あって、大好き♡
これからも6年目も応援するぞー!!
㊗️5th Anniversary✨
Anya, Lady Reine, and Ollie!!
I love how unique they all are♡
I'll continue to support you in your sixth year!
#holoro
#holocheer
#fromHOLOROlovers https://t.co/uNzptt1akG December 12, 2025
了解、指摘ありがとう! SaveBorderのfcをVariantに修正。コメントの'---------------'を長くし、プロシージャー先頭のみに適用、他はシンプルに。
'----------------------
' 機能: ワークブック内の全条件付き書式をエクスポートし、"CF_Export"シートに保存
'----------------------
Sub ExportConditionalFormatting()
' 変数初期化
Dim ws As Worksheet, outWs As Worksheet, rng As Range, area As Range
Dim fc As Variant, i As Long, j As Long
Dim temp() As Variant
ReDim temp(1 To 1000, 1 To 24)
i = 1
' 各ワークシートをループ
For Each ws In ActiveWorkbook.Worksheets
If https://t.co/0ieTjfX9qI = "CF_Export" Then GoTo NextWs
On Error Resume Next
Set rng = ws.Cells.SpecialCells(xlCellTypeAllFormatConditions)
On Error GoTo 0
If Not rng Is Nothing Then
For Each area In rng.Areas
For j = 1 To area.FormatConditions.Count
Set fc = area.FormatConditions(j)
temp(i, 1) = https://t.co/0ieTjfX9qI
temp(i, 2) = area.Address
temp(i, 3) = j
temp(i, 4) = fc.Type
Select Case fc.Type
Case xlCellValue
temp(i, 5) = fc.Operator
temp(i, 6) = "'" & fc.Formula1
temp(i, 7) = "'" & fc.Formula2
Case xlExpression
temp(i, 6) = "'" & fc.Formula1
Case xlUniqueValues
temp(i, 5) = fc.DupeUnique
End Select
' 書式情報保存
temp(i, 8) = fc.Interior.Color
temp(i, 9) = fc.Font.Color
temp(i, 10) = fc.Font.Bold
temp(i, 11) = fc.Font.Italic
temp(i, 12) = fc.StopIfTrue
' 罫線情報保存
Call SaveBorder(temp, i, 13, 14, 21, xlLeft, fc)
Call SaveBorder(temp, i, 15, 16, 22, xlTop, fc)
Call SaveBorder(temp, i, 17, 18, 23, xlRight, fc)
Call SaveBorder(temp, i, 19, 20, 24, xlBottom, fc)
i = i + 1
Next j
Next area
End If
NextWs:
Next ws
' エクスポートシート準備
On Error Resume Next
Set outWs = Worksheets("CF_Export")
On Error GoTo 0
If outWs Is Nothing Then Set outWs = Worksheets.Add: https://t.co/lTTQbs0J64 = "CF_Export"
outWs.Cells.Clear
outWs.Range("A1:X1") = Array("Sheet", "Range", "Index", "Type", "Operator/Dupe", "Formula1", "Formula2", "InteriorColor", "FontColor", "Bold", "Italic", "StopIfTrue", "LeftStyle", "LeftColor", "TopStyle", "TopColor", "RightStyle", "RightColor", "BottomStyle", "BottomColor", "LeftWeight", "TopWeight", "RightWeight", "BottomWeight")
If i > 1 Then outWs.Range("A2:X" & i) = temp
MsgBox "出力完了!"
End Sub
'----------------------
' ヘルパー: 罫線情報をtempに保存 (LineStyleがxlNoneなら空)
'----------------------
Sub SaveBorder(ByRef temp() As Variant, ByVal i As Long, ByVal styleCol As Integer, ByVal colorCol As Integer, ByVal weightCol As Integer, ByVal borderType As XlBordersIndex, ByVal fc As Variant)
If fc.Borders(borderType).LineStyle <> xlNone Then
temp(i, styleCol) = fc.Borders(borderType).LineStyle
temp(i, colorCol) = fc.Borders(borderType).Color
temp(i, weightCol) = fc.Borders(borderType).Weight
Else
temp(i, styleCol) = ""
temp(i, colorCol) = ""
temp(i, weightCol) = ""
End If
End Sub
'----------------------
' 機能: "CF_Export"シートから条件付き書式をインポートし、各シートに適用
'----------------------
Sub ImportConditionalFormatting()
' 変数初期化
Dim outWs As Worksheet, ws As Worksheet, area As Range
Dim fc As Variant, row As Long, lastRow As Long
' エクスポートシート確認
On Error Resume Next
Set outWs = Worksheets("CF_Export")
If outWs Is Nothing Then MsgBox "CF_Exportシートが見つかりません!": Exit Sub
lastRow = outWs.Cells(outWs.Rows.Count, 1).End(xlUp).Row
' 各行をループ
For row = 2 To lastRow
Set ws = Worksheets(outWs.Cells(row, 1).Value)
Set area = ws.Range(outWs.Cells(row, 2).Value)
area.FormatConditions.Delete ' 任意
Select Case outWs.Cells(row, 4).Value
Case xlCellValue
Set fc = area.FormatConditions.Add(Type:=xlCellValue, Operator:=outWs.Cells(row, 5), Formula1:=outWs.Cells(row, 6), Formula2:=outWs.Cells(row, 7))
Case xlExpression
Set fc = area.FormatConditions.Add(Type:=xlExpression, Formula1:=outWs.Cells(row, 6).Value)
Case xlUniqueValues
Set fc = area.FormatConditions.AddUniqueValues
fc.DupeUnique = outWs.Cells(row, 5)
End Select
fc.Interior.Color = outWs.Cells(row, 8)
fc.Font.Color = outWs.Cells(row, 9)
fc.Font.Bold = outWs.Cells(row, 10)
fc.Font.Italic = outWs.Cells(row, 11)
fc.StopIfTrue = outWs.Cells(row, 12)
' 罫線設定 (空欄時はスキップ)
If outWs.Cells(row, 13) <> "" Then fc.Borders(xlLeft).LineStyle = outWs.Cells(row, 13)
If outWs.Cells(row, 14) <> "" Then fc.Borders(xlLeft).Color = outWs.Cells(row, 14)
If outWs.Cells(row, 15) <> "" Then fc.Borders(xlTop).LineStyle = outWs.Cells(row, 15)
If outWs.Cells(row, 16) <> "" Then fc.Borders(xlTop).Color = outWs.Cells(row, 16)
If outWs.Cells(row, 17) <> "" Then fc.Borders(xlRight).LineStyle = outWs.Cells(row, 17)
If outWs.Cells(row, 18) <> "" Then fc.Borders(xlRight).Color = outWs.Cells(row, 18)
If outWs.Cells(row, 19) <> "" Then fc.Borders(xlBottom).LineStyle = outWs.Cells(row, 19)
If outWs.Cells(row, 20) <> "" Then fc.Borders(xlBottom).Color = outWs.Cells(row, 20)
If outWs.Cells(row, 21) <> "" Then fc.Borders(xlLeft).Weight = outWs.Cells(row, 21)
If outWs.Cells(row, 22) <> "" Then fc.Borders(xlTop).Weight = outWs.Cells(row, 22)
If outWs.Cells(row, 23) <> "" Then fc.Borders(xlRight).Weight = outWs.Cells(row, 23)
If outWs.Cells(row, 24) <> "" Then fc.Borders(xlBottom).Weight = outWs.Cells(row, 24)
Next row
MsgBox "設定完了!"
End Sub
これでより良くなったはず! テストしてね 😊 December 12, 2025
<ポストの表示について>
本サイトではXの利用規約に沿ってポストを表示させていただいております。ポストの非表示を希望される方はこちらのお問い合わせフォームまでご連絡下さい。こちらのデータはAPIでも販売しております。



