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

¦Û°Ê½Æ»s¦³¸ê®Æªº°Ï¶ô

ÁÂÁ¶W¯Åª©¥D,¥i¥H¹B§@¤F!¨ü±Ð¤F.:)
§Ú·Q°Ý´X­Ó°ÝÃD: a) ª©¥D¶K¥X¨Óªºµ{¦¡¬°¤°»ò¥ªÃä³£¦³¦æ¸¹,«ç»ò°µªº?   b)¥Î¿ý»sªº¥¨¶°¨äµ{¦¡»y¨¥¬°¤°»ò¸ò§A¼g¥X¨Óªº¤£¤@¼Ë?§A¼g¥X¨Óªºµ{¦¡¤]¥i¥H¦bexcel VBA¤¤¨Ï¥Î,¦ý³o¬O¤°»òµ{¦¡»y¨¥?­þºØµ{¦¡»y¨¥¥i¥H¦@¥Î¦bexcel¤¤?       c) §Ú§¹¥þ¤£·|¼gµ{¦¡,¦pªG§Ú·Q¦Û¾Ç,¤°»ò»y¨¥¬O¤Jªù,¦³¨S¦³±ÀÂ˪º®Ñ?   d)   .Range("A:CZ").AutoFilter Field:=70, Criteria1:=Array( _
        "Delay", "OK", "pre-Booking"), Operator:=xlFilterValues ¬O¦³±ø¥óªº¿z¿ï¸ê®Æ,¦ý§Ú­nÅý¿z¿ï¦Û°Ê¨ú®ø­n«ç»ò¼g?
   e)³Ì«á¤@­Ó°ÝÃD,¦p«e­±§A©Ò¼gªºµ{¦¡11¦æ     a.Copy .[A1],¬O±N«á­±ªºµ{¦¡¥s°µ[A1],­Y¦P¤@­Ó¥¨¶°¤¤§Ú·Q¥Î¦P¼Ëªº¤âªkcopy¤£¦Pªº¸ê®Æ,«h¬O§_­n±N[A1]§ï¬°[A2]©Î¨ä¥¦¥N½X?

TOP

  1. Sub Ex()
  2.     With ThisWorkbook.Sheets("BCM±±ºÞ")
  3.     .Columns("A:CZ").Hidden = False

  4.     .Range("A:CZ").AutoFilter Field:=70, Criteria1:=Array( _
  5.         "Delay", "OK", "pre-Booking"), Operator:=xlFilterValues
  6.          
  7.    Set a = Intersect(.UsedRange, .Range("E:BW")).SpecialCells(xlCellTypeVisible)
  8.    With Workbooks.Add
  9.    With .Sheets(1)
  10.     a.Copy .[A1]
  11.     .Columns("BO:BQ").Delete Shift:=xlToLeft
  12.     Columns("BD:BM").Delete Shift:=xlToLeft
  13.     Columns("AX:AX").Delete Shift:=xlToLeft
  14.     Columns("AM:AU").Delete Shift:=xlToLeft
  15.     Columns("AA:AA").Delete Shift:=xlToLeft
  16.     Columns("V:W").Delete Shift:=xlToLeft
  17.     Columns("S:T").Delete Shift:=xlToLeft
  18.    End With
  19.    '.SaveAs "D:\¥t¦s·sÀÉ.xlsx"   '¦¹³BÀx¦sÀÉ®×
  20.    End With
  21.    End With
  22. End Sub
½Æ»s¥N½X
¦^´_ 6# PJChen
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

[attach]excel[/attach]«e­±ªº»¡©ú+¤W¶ÇÀÉ®×,©Î³\¯à¤ñ¸û©ú¥Õ§Ú¦b»¡¤°»ò?½Ð¤j®aÀ°­Ó¦£!ÁÂÁÂ

VBA Cluster.zip (83.23 KB)

excel

TOP

§Ú»Ý­nµ½¤ß¤H¤h¨ÓÀ°¦£,­þ¦ì¤j®v¥i¥HÀ°§Ú¬Ý¬Ý¤W­±ªºµ{¦¡¥X¤F¤°»ò°ÝÃD?±Ï©R!

TOP

¤j®v,¥i§_À°¦£¬Ý¬Ý­þ¸Ì¥X¤F°ÝÃD? §Úªº¤u§@ªí¨C¤Ñ³£·|¼W¥[·sªº¸ê®Æ,§Ú¦bcopy¤u§@ªí¸ê®Æ®É·|°µ¨Ç¿z¿ï¦A¶i¦æcopy..
    Windows("VBA Cluster.xlsm").Activate
    Sheets("BCM±±ºÞ").Select
    Columns("A:CZ").Select
    Selection.EntireColumn.Hidden = False
    ActiveSheet.Range("$A$1CZ$1800").AutoFilter Field:=70, Criteria1:=Array( _
        "Delay", "OK", "pre-Booking"), Operator:=xlFilterValues          '³o¬O¦³¶i¦æ¿z¿ï«áªº
    Range("E1:BW1800").Select    '³o¸Ìªº¸ê®ÆÀH®É·|¼W¥[,¦³¥i¯à¬OE1:BW2000,©ÎªÌ§Oªº¤u§@ªí¤]·|COPY¤£¦Pªº¸ê®Æ,¦³¥i¯à¬OB2:G500,¦]¬°«Ü¦h¤u§@ªí¥Î±o¨ì³o­Ó¥\¯à,§Ú§Æ±æ¦b¶i¦æ¿z¿ï«á,¥uCOPY¦³¸ê®Æªº¦a¤è,¦Ó¤£­n¤j½d³òªºCOPY,·|³y¦¨¤Ó¦h©U§£,«e­±oobird±Ð§Ú¥Î"
ActiveSheet.UsedRange.Copy Sheet3.[A65536].End(3)(2, 1)",¦ý³£µLªk°õ¦æ,½Ð°ª¤âÀ°¦£§ä§ä­ì¦]¥X¦b­þ?

    Selection.Copy
    Workbooks.Add
    ActiveSheet.Paste
   
ActiveSheet.UsedRange.Copy SheetsBCM±±ºÞ.[A65536].End(3)(2, 1).Select  '§Ú®M¥Î«á,³o¸ÌµLªk°õ¦æ
      
    Workbooks.Add
    ActiveSheet.Paste

TOP

¤j¤j¦n,
§Ú±N§A¦^´_ªº¼gªk®M¨ì§Úªº¥¨¶°¤¤,¦ýµLªk°õ¦æ,Àˬd¤£¥X­þ¸Ì¤£¹ï,§Úcopy¥X¨Ó,¥i§_À°¦£¬Ý¤@¤U?
    Windows("VBA Cluster.xlsm").Activate
    Sheets("BCM±±ºÞ").Select
    Columns("A:CZ").Select
    Selection.EntireColumn.Hidden = False
    ActiveSheet.Range("$A$1CZ$1800").AutoFilter Field:=70, Criteria1:=Array( _
        "Delay", "OK", "pre-Booking"), Operator:=xlFilterValues         
    Range("E1:BW1800").Select
    Selection.Copy
    Workbooks.Add
    ActiveSheet.Paste
    Columns("BO:BQ").Select
    Selection.Delete Shift:=xlToLeft
    Columns("BD:BM").Select
    Selection.Delete Shift:=xlToLeft
    Columns("AX:AX").Select
    Selection.Delete Shift:=xlToLeft
    Columns("AM:AU").Select
    Selection.Delete Shift:=xlToLeft
    Columns("AA:AA").Select
    Selection.Delete Shift:=xlToLeft
    Columns("V:W").Select
    Selection.Delete Shift:=xlToLeft
    Columns("S:T").Select
    Selection.Delete Shift:=xlToLeft   
ActiveSheet.UsedRange.Copy SheetsBCM±±ºÞ.[A65536].End(3)(2, 1).Select  =>³o¸ÌµLªk°õ¦æ

    'Range("A1:AQ350").Select
    Selection.Copy
   
    Workbooks.Add
    ActiveSheet.Paste

TOP

ActiveSheet.UsedRange.Copy Sheet3.[A65536].End(3)(2, 1)

TOP

        ÀR«ä¦Û¦b : ¤Hªº²´·úªø¦b«e­±¡A¥u¬Ý¨ì§O¤Hªº¯ÊÂI¡Aµ·²@¬Ý¤£¨ì¦Û¤vªº¯ÊÂI¡C
ªð¦^¦Cªí ¤W¤@¥DÃD