- ©«¤l
- 605
- ¥DÃD
- 92
- ºëµØ
- 0
- ¿n¤À
- 648
- ÂI¦W
- 0
- §@·~¨t²Î
- windows
- ³nÅ骩¥»
- 7
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- macau
- µù¥U®É¶¡
- 2013-4-5
- ³Ì«áµn¿ý
- 2019-2-10
|
¦^´_ 7# hank10459
here is the code.- Private Sub Worksheet_Activate()
- With Sheets(2)
- blnk = .[R4] <> "" Or .[R5] <> "" Or .[R6] <> "" _
- Or .[S5] <> "" Or .[S6] <> "" _
- Or .[T5] <> "" Or .[T6] <> ""
- End With
- If blnk Then
- Range("R4:T6").Select
- With Selection
- .WrapText = False
- .Orientation = 0
- .AddIndent = False
- .ShrinkToFit = False
- .ReadingOrder = xlContext
- .MergeCells = True
- End With
- With Selection.Borders(xlDiagonalDown)
- .LineStyle = xlContinuous
- .ColorIndex = xlAutomatic
- .TintAndShade = 0
- .Weight = xlMedium
- End With
- With Selection.Borders(xlDiagonalUp)
- .LineStyle = xlContinuous
- .ColorIndex = xlAutomatic
- .TintAndShade = 0
- .Weight = xlMedium
- End With
- With Selection.Borders(xlEdgeLeft)
- .LineStyle = xlContinuous
- .ColorIndex = xlAutomatic
- .TintAndShade = 0
- .Weight = xlMedium
- End With
- With Selection.Borders(xlEdgeTop)
- .LineStyle = xlContinuous
- .ColorIndex = xlAutomatic
- .TintAndShade = 0
- .Weight = xlMedium
- End With
- With Selection.Borders(xlEdgeBottom)
- .LineStyle = xlContinuous
- .ColorIndex = xlAutomatic
- .TintAndShade = 0
- .Weight = xlMedium
- End With
- With Selection.Borders(xlEdgeRight)
- .LineStyle = xlContinuous
- .ColorIndex = xlAutomatic
- .TintAndShade = 0
- .Weight = xlMedium
- End With
- Selection.Borders(xlInsideVertical).LineStyle = xlNone
- Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
- Else
- Range("O4:Q6").Select
- ActiveWindow.SmallScroll Down:=-6
- Selection.Copy
- Range("R4").Select
- Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
- SkipBlanks:=False, Transpose:=False
- Application.CutCopyMode = False
- Range("F4:H6").Select
- Selection.Copy
- Range("U4:W6").Select
- Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
- SkipBlanks:=False, Transpose:=False
- Application.CutCopyMode = False
- End If
- End Sub
½Æ»s¥N½X |
|