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

[µo°Ý] ±N¸ê®Æ¦Û°Ê¤ÀÃþ¥\¯à

¦^´_ 40# GBKEE


    G¤j¡A¦³¿ù»~²£¥Í

01.Option Explicit

02.Private Sub CommandButton2_Click()

03.    Sheets("°Ñ·Óªí").UsedRange.Columns(1).CreateNames True

04.    With Sheets("Sheet1").Range("G2:G150").Validation

05.        .Add Type:=xlValidateList, Formula1:="=" & Sheets("°Ñ·Óªí").UsedRange.Cells(1)

06.    End With

07.End Sub


²Ä05¦æ¡A¿ù»~1004¡AÀ³¥Îµ{¦¡©Îª«¥ó©w¸q¤Wªº¿ù»~
¤£¾å±o¬°¤°»ò·|³o¼Ë
ÁÂÁÂ
«¢Åo~¤j®a¦n§r

TOP

¦^´_ 41# iceandy6150
  1. Private Sub CommandButton2_Click()
  2.     Sheets("°Ñ·Óªí").UsedRange.Columns(1).CreateNames True
  3.     With Sheets("Sheet1").Range("G2:G150").Validation
  4.         .Delete  '¥[¤W³o¦æ ¦pÁÙ¦³¿ù»~,½Ð¤W¶ÇÀÉ®×
  5.       '.Delete  2003ª©¥i¤£¥Î.
  6.         .Add Type:=xlValidateList, Formula1:="=" & Sheets("°Ñ·Óªí").UsedRange.Cells(1)
  7.     End With
  8. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 42# GBKEE


    G¤j¥i¥H¤F­C
³o¤]¤Ó¯«©_¤F¡A¬°¤°»ò·|³o¼Ë©O? ¥i¥H«ü¾É»¡©ú¤@¤U¶Ü?ÁÂÁÂ
«¢Åo~¤j®a¦n§r

TOP

¦^´_ 43# iceandy6150
OFFICEªºª©¥»¤£¦P
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 44# GBKEE

§Ú¥i¤£¥i¥H¦b½Ð°Ý¤@¤U  UsedRangeªº¥Îªk

§Úµo²{¦pªG¤@­Ó¤u§@ªíªºA1~A10¦³µe®Ø½u (©ÎºÙ¬°ªí®æ¤]¦æ)

µM«á¥u¦³A1~A5¶ñ¤J¸ê®Æ¡AA6~A10¬OªÅ®æ

³o¼Ë±¡ªp¤U  ¨Ï¥Îwith sheets("¤u§@ªí")

.UsedRange.Rows.count·|ºâ¨ì10¡A¦Ó¤£¬O5

­Y°w¹ï.UsedRange³o­Ó½d³ò¥h¨Ï¥ÎCountA·|¼Æ¥X5­Ó

¦ý¦pªG§Ú¤£·Q­pºâ®Ø½u¡A¤]¤£¬O­nºâ³o­Ó½d³ò¤¤¦³¼Æ­Èªº¬O´X­Ó
¥u·Q§ä¨ì¦³¶ñ¤J¼Æ­Èªº³Ì«á¤@­Ó®æ¤l
¦Ó¥B¤¤¶¡¥i¯à·|¦³ªÅ®æ¡A¸Ó«ç»ò¿ì©O?

¦p¤U¹Ï¡A§Ú·Q§äGÄ檺³Ì«á¤@µ§¸ê®Æ¡A¥Ø«e¬OG55
¥i¬O¨C­Ó¤ë¼W¥[¸ê®Æ«á¡A¥i¯à·|ÅÜG58¡BG63µ¥µ¥ªº

«¢Åo~¤j®a¦n§r

TOP

¦^´_ 45# iceandy6150
  1. End ÄÝ©Ê ¸Óª«¥ó¥Nªí¥]§t¨Ó·½½d³ò¤§°Ï°ìµ²§À³BªºÀx¦s®æ¡Cµ¥©ó«ö END+¦V¤WÁä¡BEND+¦V¤UÁä¡BEND+¦V¥ªÁä©Î END+¦V¥kÁä¡C°ßŪ Range ª«¥ó¡C
  2. expression.End (Direction)
  3. Direction    ¥²¿ïªº XlDirection ¸ê®ÆÃþ«¬¡C­n²¾©¹ªº¤è¦V¡C
  4. XlDirection ¥i¥H¬O³o¨Ç XlDirection ±`¼Æ¤§¤@¡C
  5. xlDown
  6. xlToRight
  7. xlToLeft
  8. xlUp
½Æ»s¥N½X
  1. Sub Ex()
  2.     With ActiveSheet.Range("G:G")
  3.        MsgBox .Cells(.Count).End(xlUp).Address
  4.     End With
  5.     With ActiveSheet
  6.        MsgBox .Range("G" & .Rows.Count).End(xlUp).Address
  7.     End With
  8.     With ActiveSheet
  9.        MsgBox .Cells(.Rows.Count, "G").End(xlUp).Address
  10.     End With
  11.     With ActiveSheet
  12.        MsgBox .Cells(.Rows.Count, 7).End(xlUp).Address
  13.     End With
  14. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¥»©«³Ì«á¥Ñ iceandy6150 ©ó 2014-2-11 23:54 ½s¿è

¦^´_ 46# GBKEE

¤j¤j¡A±z¼g±oµ{¦¡¥¿±`¹B§@µL»~¡A·PÁÂ
¥u¬O§Ú¦³ÂI¦n©_   .Range("G" & .Rows.Count).End(xlUp).Address
§Ú¬O§ï¦¨.Range("G" & .Rows.Count).End(xlUp).Value
¦]¬°§Ú»Ý­n¨º¤@®æªº­È
¦n©_ªº¦a¤è¬O¬°¤°»ò±z¥Î xlup ?
§Ú­Ì¤£¬O­n§ä¬Y½d³ò³Ì¤U­±¤@®æÀx¦s®æ¡AÀ³¸Ó¬Oxldown?

¥t¥~·Q¦b½Ð°Ý¤@­ÓÀYµhªº°ÝÃD
¦p¤U¹Ï
¬O¤@­ÓÃþ¦ü·|­p­p±bªºEXCELªí®æ
«Ü¥O¤H¶Ì²´ªº¬O¡A¤ë¥÷¤¤¶¡©~µM·|¦³ªÅ¥Õ³B (¸ê®Æ¤£³sÄò)
µM«á¤é´Á¤]¥u¦³¥´¤ë¡B¤é
¯u¥¿·|¥Î¨ìªº¼Æ¦r¬O¦b¬õ¦â®æ½uªº¤W­±
¥H¤H²´¬Ý¡A¬OÁÙºâ²M·¡¡A¦ý¬O­n¥Îµ{¦¡§ì¸ê®Æ¡A«ÜÀY¤j®º
¦]¬°¤£¬O¨C¤@±Æ³£¦³¦~¤ë¤é¥i¥H°Ñ¦Ò



ÁÙ¦³§ó¶Ì²´ªº¦p¤U¹Ï



§âEXCEL·í§@ï¤l¨Ï¥Î¡A³s­¶¼Æ³£¦³¡A¦ý¬O102¦~¥u¦³¤@®æ
¤U­±ªº´N³q³q¥Nªí102¦~µo¥Íªº¤F
µM«á¤£¬O¨C­Ó¤ë³£¦³¸ê®Æ¡A¥»¹Ï¥u¦³1¡B6¡B12¤ë¤~¦³¸ê®Æ
¦Ó¥B¥»¹Ï¬O­n§ìFÄæ¦ì¡A¬õ¦â®æ½u¤W¤è828,170¨º­Ó¼Æ¾Ú


©Ò»Ý¥\¯à·§­z¡G
°²³]¦³A,B,C,D,E¤­ºØ·|­p¬ì¥Ø¡A¤À§O¬O¤­±i¤u§@ªí
¥t¥~¨C­Ó¤ëµ²ºâ»Ý­n¤@­Óµ²ºâ¤u§@ªí
»Ý­n¨ìA,B,C,D,E¥h§ì¸ê®Æ¡A¨ì<µ²ºâ>¤u§@ªí¡A¦A¥h¥[¥[´î´î

¨ºA,B,C¤u§@ªí¥i¯à¬O¹³¹Ï1¡A¨C­Ó¤ë¤@©w¦³¸ê®Æ¡A¦ý·|¦³ªÅ®æ
§Ú¥u­n§äGÄæ³Ì¤U¤è¤@­Ó¼Æ­È¡A¶K¹L¥h<µ²ºâ>¡A´N§¹¦¨¤F
(³oÃä¤]¨Ï¥ÎG¤j±Ð¾Ç¡A¤w¥i°õ¦æ)

¦ýD,E¤u§@ªí¥i¯à¬O¹³¹Ï2
¸ê®Æ¤£¬O¨C­Ó¤ë³£¦³
¤ñ¦p§Ú­nµ²103¦~02¤ëªº¸ê®Æ
ABC¬O¨S°ÝÃD
DE¦pªG¦³103¦~02¤ëªº¸ê®Æ¤~§ì¨ì<µ²ºâ>
¦pªG¦p¹Ï2¡A¨S¦³¸ê®Æ«h¤£§ì

­n¬O§Ú¨Ï¥Î.Range("F" & .Rows.Count).End(xlUp).Value
¶Õ¥²·|§ì¿ù¡A§â102¦~12¤ë31¤éªº828170³oµ§¸ê®Æ»~¶K¹L¥h<µ²ºâ>
¦Ó¨ººØ©Ç²§ªº¦~¤ë¤é®æ¦¡¡A¦p¦óÅýµ{¦¡¤£·|»~§P©O?

ÁÂÁÂ
«¢Åo~¤j®a¦n§r

TOP

¦^´_ 47# iceandy6150
.Rows.Count : ¶Ç¦^ª«¥ó¦CªºÁ`¼Æ
.Range("G" & .Rows.Count) : ³oÀx¦s®æ¬O¦ì©óGÄæ³Ì©³³¡ªº¦C¸¹
¬°¤°»ò¬O xlup ? (©¹¤W),¤£¬O À³¸Ó¬Oxldown(©¹¤U)
Range("G" & .Rows.Count).End(xldown).Value  :ÁÙ¬O³Ì©³³¡¦CªºÀx¦s®æ

½Ð±NÀɮתº½d¨Ò¤W¶Ç¬Ý¬Ý
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 48# GBKEE

¤j¤j¡A·PÁ¸ѻ¡

ÀɮקڧR±¼¤@¨ÇªF¦è«á¡A¤W¶Ç
¸Ì­±³Ì¥kÃä¬O<·l¯qªí>
ÂŦâ½d³ò¬O­n¥h§äªº¬ÛÃöÃþ§O¤u§@ªí
§Ú¦³³]¤@­Ó«ö¶s¡A¼g¤F³¡¤Àªºµ{¦¡
¾ï¦â¬O­n¶ñ¤J¸ê®Æªº¦a¤è

¨ä¾l¨SÃC¦âªº³¡¤À´N¼È¤£³B²z
¨Æ«á§Ú¦A­×´N¦n



§Ú·Q¬O¤£¬O­n³]¤@­Ó¿é¤J°Ï
¸ß°Ý¨Ï¥ÎªÌ·Q²£¥Í­þ¤@­Ó¤ëªº·l¯qªí
¨Ò¦p103¦~01¤ë

¨ºµ{¦¡´N¥h¦UÃþ¤u§@ªí¡A¦pªG¦³103¦~01¤ëªº¸ê®Æ
´N©ñ¨ì<·l¯qªí>¬ÛÃöÄæ¦ì¥h
¦pªG¨S¦³¡A´N¤£©ñ

¥u¬O¦UÃþ¤u§@ªí¯uªºªø±o«Ü©Ç....

Á`¤ÀÃþ±b-¤W¶Ç¥Î.rar (101.29 KB)
«¢Åo~¤j®a¦n§r

TOP

¦^´_ 49# iceandy6150
  1. '¶O¥Î¶µ¥Ø¤¤ "¬z  ¶K",¦³ªÅ®æ,¤u§@ªí¦WºÙ"¬z¶K59-60"¤¤¨SªÅ®æ
  2. '©Ò¦³¶O¥Î¶µ¥Ø»Ý»P¤u§@ªí¦WºÙ(¶O¥Î¶µ¥Ø??_??)¤@­P
  3. '§_«h Sh = Filter(Ar, Trim(Rng(1).Cells(i)), True) ·|¤£¥¿½T'
  4. Option Explicit
  5. Sub Ex()
  6.     Dim xlMon As Integer, xlYear As String, E As Variant
  7.     Dim Rng(1 To 2) As Range, Rng_Ar(), Ar(), i As Integer, Sh As Variant
  8.     With Sheets("·l¯qªí")
  9.         xlYear = Mid(.[a3], InStrRev(.[a3], "¦Ü") + 1, InStrRev(.[a3], "¦~") - InStrRev(.[a3], "¦Ü"))
  10.         'xlYear : ·l¯qªíªº¦~«×
  11.         xlMon = Mid(.[a3], InStrRev(.[a3], "¦~") + 1, InStrRev(.[a3], "¤ë") - InStrRev(.[a3], "¦~") - 1)
  12.         'xlMon : ·l¯qªíªº¤ë¥÷
  13.         Set Rng(1) = .[A18:A30]                         '¶O¥Î¶µ¥Ø
  14.         ReDim Rng_Ar(1 To Rng(1).Count)                 '°}¦C:¤¸¯À¼Æ = ¶O¥Î¶µ¥Ø¼Æ
  15.     End With
  16.     ReDim Ar(1 To Sheets.Count)                         '°}¦C:¤¸¯À¼Æ = Sheets.Count
  17.     For i = 1 To Sheets.Count
  18.         Ar(i) = Sheets(i).Name                          '°}¦C:¤¸¯À¾É¤J Sheets.Name
  19.     Next
  20.     For i = 1 To Rng(1).Count
  21.         Sh = Filter(Ar, Trim(Rng(1).Cells(i)), True)
  22.         'Filter ¨ç¼Æ ¶Ç¦^¤@­Ó±q¹s¶}©lªº°}¦C¡A¸Ó°}¦C¥]§t°ò©ó«ü©w¿z¿ï·Ç«hªº¤@­Ó¦r¦ê°}¦Cªº¤l¶°¡C
  23.         For Each E In Sh
  24.             With Sheets(E)                              '¦³"¶O¥Î¶µ¥Ø"¦WºÙªº ¤u§@ªí
  25.                 Set Rng(2) = .[A:B].Find(xlYear, lookat:=xlWhole, LookIn:=xlValues) '®Ö¹ï¦~«×
  26.                 If Not Rng(2) Is Nothing Then
  27.                     Set Rng(2) = .[a:a].Find(xlMon, lookat:=xlWhole)                '·j´M¤ë¥÷
  28.                     If Not Rng(2) Is Nothing Then
  29.                         Rng_Ar(i) = Rng_Ar(i) + Rng(2).Range("F1")                  'Range("F1"):ª÷ÃB¦ì¸m
  30.                     End If
  31.                 End If
  32.             End With
  33.         Next
  34.     Next
  35.     Rng(1).Offset(, 1) = Application.WorksheetFunction.Transpose(Rng_Ar)
  36.     'Transpose(Âà¸m) : ¤@ºû°}¦C(¾î¦¡) Âà´«¬° ¤Gºû°}¦C(³o¸ÌÅܤ@¦Cª½¦¡)
  37. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¥Í®ð¡A´N¬O®³§O¤Hªº¹L¿ù¨ÓÃg»@¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD