Âü°í·Î, ±âÁ¸ ÀÏÁö¿¡¼ 4¹ø ½º¸¶Æ®µµ¼°ü ³»¿ëÀ» Ãß°¡Çß¾î¿ä.. ¸ÅÅ©·Î Àß ¸ô¶ó¼ Ã¥º¸°íÇϴµ¥ ¾î·Æ³×¿ä ¤Ð¤Ð
Sub dataSave()
Dim lngR As Long
Dim lngC As Long
Dim lst() As Variant
Dim c As Long
Dim r As Long
Dim i As Long
Dim m As Long
Dim tmp As Long
Dim lngAns As Long
With Sheet1
lngR = .Cells(Rows.Count, "A").End(xlUp).Row
lngC = .Cells(4, Columns.Count).End(xlToLeft).Column - 1
For i = 3 To lngR
If .Cells(i, "A").Value = Sheet328.Range("A4").Value Then
lngAns = MsgBox("ÀÌ¹Ì ÀúÀåµÈ ³¯Â¥ÀÔ´Ï´Ù" & Chr(10) & "µ¤¾î¾²½Ã°Ú½À´Ï±î?", _
vbYesNo + vbQuestion, strCoName)
If lngAns = vbYes Then
lngR = i - 1
Else
Exit Sub
End If
End If
Next
.Cells(lngR + 1, "A").Value = Sheet328.Range("A4").Value
End With
With Sheet328
ReDim lst(1 To lngC)
i = 0
For r = 7 To 9 '1.ÀÚ·áÀÌ¿ëÇöȲ-°ü¿Ü
For c = 3 To 12
i = i + 1
lst(i) = .Cells(r, c).Value
Next c
Next r
For r = 12 To 14 '1.ÀÚ·áÀÌ¿ëÇöȲ-°ü³»
For c = 3 To 12
i = i + 1
lst(i) = .Cells(r, c).Value
Next c
Next r
For r = 21 To 23 '2.ÀÌ¿ëÀÚÇöȲ-°ü¿Ü
i = i + 1
lst(i) = .Cells(r, 3).Value
Next r
For r = 26 To 28 '2.ÀÌ¿ëÀÚÇöȲ-°ü³»
i = i + 1
lst(i) = .Cells(r, 3).Value
Next r
'3.ȸ¿ø¼ö
i = i + 1
lst(i) = .Cells(22, "H").Value
i = i + 1
If lngR = 4 And .Cells(22, 8).Value = Sheet1.Cells(lngR + 1, 68).Value Then
lst(i) = Sheet1.Cells(lngR + 1, 68).Value
Else
lst(i) = .Cells(22, "N").Value
End If
For m = 28 To 30 '4.½º¸¶Æ®¹«Àεµ¼°ü ÀÌ¿ëÇöȲ-ÀÌ¿ëÃ¥¼ö
i = i + 1
lst(i) = .Cells(m, 10).Value
Next m
For m = 28 To 30 '4.½º¸¶Æ®¹«Àε·¼°ü ÀÌ¿ëÇöȲ-ÀÌ¿ëÀÚ¼ö
i = i + 1
lst(i) = .Cells(m, 13).Value
Next m
For c = 4 To 13 '5.ÀÚ·á ÇöȲ
i = i + 1
lst(i) = .Cells(36, c).Value
Next c
i = i + 1
lst(i) = .Cells(40, "A").Value
End With
With Sheet1
.Cells(lngR + 1, "B").Resize(1, lngC) = lst
With .Sort 'µ¥ÀÌÅÍ ¹üÀ§ ¿À¸§Â÷¼ø Á¤·Ä
.SetRange Range("5:" & lngR + 1)
.Header = xlNo
.Orientation = xlTopToBottom
.Apply
End With
End With
Erase lst
End Sub
|