ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ½Ð°Ý¦¹¬q¥¨¶°¦p¦ó²¤Æ©Î¥[§Ö³t«×??

¦^´_ 2# GBKEE
§Ú¤]¦³¤@¬q¥¨¶°¸Ó¦p²¤Æ?
Private Sub format()

Dim ws As Worksheet
Dim sName As String

sName = "PTAVS"
On Error Resume Next
Set ws = Sheets(sName)

If ws Is Nothing Then
    Worksheets.Add after:=Worksheets(Worksheets.Count)
    Worksheets(Worksheets.Count).Name = sName
    ws.Activate
Else
    MsgBox sName & "¤u§@ªí¤w¦s¦b¡C"
    Sheets("Result").Select
    Exit Sub
End If

Cells.Select
    With Selection
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    With Selection.Font
        .Name = "Arial"
        .Size = 10
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
        .TintAndShade = 0
        .ThemeFont = xlThemeFontNone
    End With

Range("B1:M1").Merge
    Range("A1:A4").Select
    With Selection
        .WrapText = False
        .MergeCells = True
        .Value = "C1~C5"
    End With
   
    Range("B2:G2").Select
    With Selection
        .WrapText = False
        .MergeCells = True
        .Value = "(sone)"
    End With
   
    Range("B3:D3").Select
    With Selection
        .WrapText = False
        .MergeCells = True
        .Value = "H"
    End With
   
    Range("E3:G3").Select
    With Selection
        .WrapText = False
        .MergeCells = True
        .Value = "M"
    End With
   
    Range("B4:G4").Select
    With Selection
        .WrapText = True
        .MergeCells = False
    End With
    Range("B4").Value = "mean"
    Range("C4").Value = "standard deviation"
    Range("D4").Value = "mean+CV*stdev"
   
    Range("B4:D4").Copy
    Range("E4").Select
    ActiveSheet.Paste
   
    Range("B2:G4").Copy
    Range("H2").Select
    ActiveSheet.Paste
   
    Range("H2").Value = "(tu)"
   
    Range("A1:M4").Select
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlInsideVertical)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlInsideHorizontal)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Font
        .Name = "Arial"
        .Size = 10
    End With
Sheets("Result").Select
End Sub
'-------------------------------------
³o¬qcode¦³«Ü¤jªº³¡¤À¬O¦b°µÀx¦s®æªº¦X¨Ö¥H¤Îµe®Ø½u ³o¸Ó¦p¦ó²¤Æ©O?

TOP

¦^´_ 11# acdx
  1. Option Explicit
  2. Private Sub format()
  3.     Dim ws As Worksheet, sName As String, AR(1 To 2), I As Integer
  4.     sName = "PTAVS"
  5.     On Error Resume Next
  6.     Set ws = Sheets(sName)
  7.     If ws Is Nothing Then
  8.         Worksheets.Add after:=Worksheets(Worksheets.Count)
  9.         Worksheets(Worksheets.Count).Name = sName
  10.         Set ws = Sheets(sName)
  11.     Else
  12.         MsgBox sName & "¤u§@ªí¤w¦s¦b¡C"
  13.         Sheets("Result").Select
  14.         Exit Sub
  15.     End If
  16.     With ws.Cells
  17.         .HorizontalAlignment = xlCenter
  18.         .VerticalAlignment = xlCenter
  19.         .Orientation = 0
  20.         .AddIndent = False
  21.         .IndentLevel = 0
  22.         .ShrinkToFit = False
  23.         .ReadingOrder = xlContext
  24.         .MergeCells = False
  25.         With .Font
  26.             .Name = "Arial"
  27.             .Size = 10
  28.             .Strikethrough = False
  29.             .Superscript = False
  30.             .Subscript = False
  31.             .OutlineFont = False
  32.             .Shadow = False
  33.             .Underline = xlUnderlineStyleNone
  34.             .ColorIndex = xlAutomatic
  35.             .TintAndShade = 0
  36.             '.ThemeFont = xlThemeFontNone  '2003¨S³o°Ñ¼Æ
  37.         End With
  38.         .Range("B1:M1").Merge
  39.         AR(1) = Array("A1:A4", "B2:G2", "B3:D3", "E3:G3", "B4:G4")
  40.         AR(2) = Array("C1~C5", "(sone)", "H", "M", "")
  41.         For I = 0 To UBound(AR(1))
  42.             With .Range(AR(1)(I))
  43.                 .WrapText = False
  44.                 .MergeCells = IIf(I < UBound(AR(1)), True, False)
  45.                 .Value = AR(2)(I)
  46.             End With
  47.         Next
  48.         .Range("B4:D4").Value = Array("mean", "standard deviation", "mean+CV*stdev")
  49.         .Range("B4:D4").Copy .Range("E4")
  50.         .Range("B2:G4").Copy .Range("H2")
  51.         .Range("H2").Value = "(tu)"
  52.         With .Range("A1:M4")
  53.             For I = 5 To 12   'µe®Ø½u
  54.                 With .Borders(I)
  55.                     .LineStyle = IIf(I >= 7, xlContinuous, xlNone)
  56.                     If I >= 7 Then .ColorIndex = 0
  57.                     'If I >= 7 Then .TintAndShade = 0       '2003®Ø½u¨S³oÄÝ©Ê
  58.                     If I >= 7 Then .Weight = xlThin
  59.                 End With
  60.             Next
  61.             .Font.Name = "Arial"
  62.             .Font.Size = 10
  63.         End With
  64.     End With
  65.     Sheets("Result").Select
  66. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 12# GBKEE
¨C¦¸¨Ó³oÃä¨D±ÏÁ`¬O¯à±qª©¤W¦U¦ì«e½úªº¸Ñµª¤¤Àò±o§Ú¥¼·Q¹Lªº¼gªk¡AÅý§Ú¤]±q¤¤¾Ç¨ì¤£¤Ö
¦b³o¸Ì¤]·Q½ÐG¤j¤¶²Ð´X¥»¤£¿ùªº¤u¨ã®ÑÅý§Ú¯à±q¤¤ºë¶i¦Û¤vªº¥\¤O
§Æ±æ±N¨Ó¦³¤@¤Ñ¤£¦A¥u¬O¤W¨Ó³oÃäµo°Ý¤]¯à¦VªO¤W´X¦ì¤j¤j¥i¥HÀ°¨ä¥L¤H¸Ñ´b ÁÂÁÂ

TOP

¦^´_ 13# acdx
¤u¨ã®Ñ¤@¯ë³£¬O¤@¼Ëªº,¦h¬Ý¦h½m²ß,¤é¤[­Ô¤@©w¥i¥H´À«á¤H¸Ñ´bªº.
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¡i¬O§_µo´§¤F¨}¯à¡H¡j¤H¶¡¹Ø©R¦]¬°µu¼È¡A¤~§óÅã±o¬Ã¶Q¡CÃø±o¨Ó¤@½ë¤H¶¡¡AÀ³°Ý¬O§_¬°¤H¶¡µo´§¤F¦Û¤vªº¨}¯à¡A¦Ó¤£­n¤@¨ý¨Dªø¹Ø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD