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

[µo°Ý] ½Ð±ÐªíÀY¸òªí§À¦C¦L

[µo°Ý] ½Ð±ÐªíÀY¸òªí§À¦C¦L


¦p¹Ïªí¥Ü,¶À¦â³¡¤À»P¤U¤@­¶¬O­«ÂЪº
¥u¦³¤¤¶¡¦C¤£¤@¼Ë
¦]¬°¤¤¶¡¦C¦³§Ç¸¹»Ý­n¤@ª½©µÄò¤U¥h
§Úª¾¹D¦³¼ÐÃD¦C¦Lªº¤èªk,¦ý§Úªº§ÀºÝ´N¨S¿ìªk¥Î³o¤èªk
·Q½Ð±Ð¦U¦ì¤j¤j..
¦³¨ä¥L¤èªk¯à¥Î¶Ü
¦]¬°§Ú»Ý­nªº­¶­±¶W¹L30­¶
¨C¦¸³£¬O¥H¤H¤u¤è¦¡½Æ»s¹ï¤u§@¤W¦³ÂI¯Ó®É..
³Â·Ð¦U¦ì¤j¤j¤F,±Ï±Ï§Ú§a..

¦^´_ 1# pop780906

§Úªº¤èªk¤ñ¸û²Â¡A¤£¹L§A¥i¥H¸Õ¸Õ¬Ý¡C
­¶§Àªº³¡¥÷§Ú¬O¥ý»s§@¹Ï¤ù¡AµM«á¦b¦Û©w­¶§À¶K¤W¹Ï¤ù¡A¦A½Õ¾ã¨ì¦Û¤w·Q­nªº®æ¦¡

TOP

¦^´_ 2# lpk187


   ÁÂÁ¤j¤j¦^ÂÐ,¦]¬°¤j¤j¬O§Æ±æ»¡¤U­±¨º¨â®æ­nª½±µ¥i¥Hkey inªº..
   ©Ò¥H´NÅܦ¨¦³ÂI³Â·Ð..

TOP

Sub zz()
Application.ScreenUpdating = 0
Application.DisplayAlerts = 0
Dim usedH, hd As Range, fn As Range, pd As Range
Set hd = Range(±zªº­¶ÀY)
Set fn = Range(±zªº­¶§À)
Set pd = ActiveSheet.UsedRange
'usedH ±N©Ò»Ý¦C¦L°ª«×²Ö¥[
For Each r In hd.Rows
  usedH = usedH + r.RowHeight
Next
For Each r In fn.Rows
  usedH = usedH + r.RowHeight
Next
'avh ¤@­¶¯à¦C¦L°ª«×
avh = 710 - Int(usedH) '¦¹³B§Ú¤£À´¦Û°Ê­pºâ, ½Ð¦Ñ®v«ü¾É
'bodyS ¤º®e¶}©l¦æ, bodyE  ¤º®eµ²§À¦æ
bodyS = hd.Rows.Count + 1
bodyE = pd.Rows.Count - fn.Rows.Count
zc = pd.Columns.Count
Sheets.Copy
Range(Cells(bodyS, 1), Cells([a65536].End(3).Row, 1)).EntireRow.Delete
'pr1 ¦C¦L¤º®e²Ä¤@¦æ
pr1 = bodyS
For i = bodyS To bodyE
    n = n + pd.Rows(i).RowHeight
    If n >= avh Then
        Range(pd.Cells(pr1, 1), pd.Cells(i, zc)).Copy Range("a" & [a65536].End(3).Row + 1)
        fn.Copy Range("a" & [a65536].End(3).Row + 1)
        pr1 = i + 1
        n = 0
        ActiveSheet.PrintOut Copies:=1
        Range(Cells(bodyS, 1), Cells([a65536].End(3).Row, 1)).EntireRow.Delete
    End If
Next
ActiveWorkbook.Close 0
Application.ScreenUpdating = 1
Application.DisplayAlerts = 1
End Sub

TOP

§Ñ¤F»¡©ú³o¬O§Úªº·Qªk¬O.
±zªº°ÝÃD¥i¯à°N¦³VBA¤~¥i¸Ñ¨M
1. ¥ý­pºâ¦C¦L­¶ªº°ª¤W­­(§Y¦b¤@­¶¤º©Ò¯à¦C¦Lªº©Ò¦³¦æ°ªÁ`©M),³o¸Ì§Ú¤£À´¦Û°Ê­pºâ, ½Ð¦Ñ®v«ü¾É
2. ¨D¥X­¶ÀYÁ`¦æ°ªªº©M
3. ¨D¥X­¶¸}Á`¦æ°ªªº©M
4. «×¥X¦C¦L¸ê®Æªº°ª
5. ¶i¦æ¨C­¶¦C¦L­«²Õ

VBA µ{§Ç¤j­P¬°¦b 4# ©Ò¼g

TOP

­è¤~¸Õ¤F¤@¤U¦³¤í,²{­×¥¿¦p¤U:

Sub zz()
Application.ScreenUpdating = 0
Application.DisplayAlerts = 0
Dim usedH, hd As Range, fn As Range, pd As Range
Set hd = Range(±zªº­¶ÀY)
Set fn = Range(±zªº­¶§À)
Set pd = ActiveSheet.UsedRange
'usedH ±N©Ò»Ý¦C¦L°ª«×²Ö¥[
For Each r In hd.Rows
  usedH = usedH + r.RowHeight
Next
For Each r In fn.Rows
  usedH = usedH + r.RowHeight
Next
'avh ¤@­¶¯à¦C¦L°ª«×
avh = 710 - Int(usedH) '¦¹³B§Ú¤£À´¦Û°Ê­pºâ, ½Ð¦Ñ®v«ü¾É
'bodyS ¤º®e¶}©l¦æ, bodyE  ¤º®eµ²§À¦æ
bodyS = hd.Rows.Count + 1
bodyE = pd.Rows.Count - fn.Rows.Count
zc = pd.Columns.Count
Sheets.Copy
Range(Cells(bodyS, 1), Cells([a65536].End(3).Row, 1)).EntireRow.Delete
'pr1 ¦C¦L¤º®e²Ä¤@¦æ
pr1 = bodyS
For i = bodyS To bodyE
    n = n + pd.Rows(i).RowHeight
    If n >= avh Then
        Range(pd.Cells(pr1, 1), pd.Cells(i, zc)).Copy Range("a" & [a65536].End(3).Row + 1)
        fn.Copy Range("a" & [a65536].End(3).Row + 1)
        pr1 = i + 1
        n = 0
        ActiveSheet.PrintOut Copies:=1
        Range(Cells(bodyS, 1), Cells([a65536].End(3).Row, 1)).EntireRow.Delete
    End If
Next
If n Then
    Range(pd.Cells(pr1, 1), pd.Cells(i, zc)).Copy Range("a" & [a65536].End(3).Row + 1)
    fn.Copy Range("a" & [a65536].End(3).Row + 1)
    ActiveSheet.PrintOut Copies:=1
    Range(Cells(bodyS, 1), Cells([a65536].End(3).Row, 1)).EntireRow.Delete
End If
ActiveWorkbook.Close 0
Application.ScreenUpdating = 1
Application.DisplayAlerts = 1
End Sub

TOP

¦^´_ 6# ikboy

ªíÀY6cm
ªí§À4cm

¬Ý¤£¤ÓÀ´°ª«×­n¥´¦b»yªkªº­þÃä..½Ð¤j¤j«ü±Ð~~ÁÂÁÂ

TOP

°²³]±zªº­¶ÀY¬O¥Ñ A1:K7
­×§ï Set hd = Range(±zªº­¶ÀY) ¬° Set hd = Range("A1:K7")
¦p¦¹Ãþ±À ­×§ï Set fn = Range(±zªº­¶§À)
¤@¯ëA4 ¤@­¶¯à®e¦æ°ª 710, ¦p ¶W¥X¤@­¶, ½Ð­×§ï avh = 710  ¬° avh = 700 ©Î§ó¤Ö

TOP

¦^´_ 8# ikboy

TEST.rar (15.89 KB)

¤£¤ÓÀ´»yªk~~¿é¤J«á¥X²{¿ù»~~~
ªþ¤Wªþ¥óExcel±Ò¥Î¥¨¶°ÀÉ®×
½Ð¤j¤j«ü¾É~~~ÁÂÁÂ>"<

TOP

«Ü©êºp,¥Ñ©ó§ÚªºÅv­­¥¼¯à¤U¸ü, ½Ð¦b¼Ò²Õ¤¤«öF8¹E¨B°õ¦æ¦Ü°ÝÃD³B,§â°ÝÃDÅã¥Ü¦A¬d¤U¡C

TOP

        ÀR«ä¦Û¦b : ­n¥Î¤ß¡A¤£­n¾Þ¤ß¡B·Ð¤ß¡C
ªð¦^¦Cªí ¤W¤@¥DÃD