|
'*************************************************************************
' ("D5:D16") と ("D20:D31")
'*************************************************************************
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
If count2 = 1 Then
Range(Cells(5 + 31 * (count1 - 1), "D"), Cells(16 + 31 * (count1 - 1), "D")).Select
Else
Range(Cells(20 + 31 * (count1 - 1), "D"), Cells(31 + 31 * (count1 - 1), "D")).Select
End If
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
'*************************************************************************
' ("G5:G16") と ("G20:G31")
'*************************************************************************
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
If count2 = 1 Then
Range(Cells(5 + 31 * (count1 - 1), "G"), Cells(16 + 31 * (count1 - 1), "G")).Select
Else
Range(Cells(20 + 31 * (count1 - 1), "G"), Cells(31 + 31 * (count1 - 1), "G")).Select
End If
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
'*************************************************************************
' ("AB5:AB16") と ("AB20:AB31")
'*************************************************************************
If count2 = 1 Then
Range(Cells(5 + 31 * (count1 - 1), "AB"), Cells(16 + 31 * (count1 - 1), "AB")).Select
Else
Range(Cells(20 + 31 * (count1 - 1), "AB"), Cells(31 + 31 * (count1 - 1), "AB")).Select
End If
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
Selection.Borders(xlEdgeLeft).LineStyle = xlNone
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
Next
'*************************************************************************
' マクロのパターンを白にする
'*************************************************************************
Range("AG32").Select
ActiveWindow.SmallScroll Down:=-17
Range("B2").Select
ActiveWindow.SmallScroll Down:=15
Range(Cells(2 + 31 * (count1 - 1), "B"), Cells(31 + 31 * (count1 - 1), "AF")).Select
With Selection.Interior
.ColorIndex = 2
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
Range("AH15").Select
Application.Goto Reference:="Macro1"
ActiveWorkbook.Save
Next
End
|
|