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

[­ì³Ð] ¥HÃöÁä¦r¿z¿ï¦h­Ósheetsªº¸ê®Æ

[­ì³Ð] ¥HÃöÁä¦r¿z¿ï¦h­Ósheetsªº¸ê®Æ

³o¬O¨Ï¥ÎVBAªº¤èªk, ¹L´X¤Ñ¦A°µ­Ó¥Î¨ç¼Æ(¤£¥ÎVBA)ªº¤èªk

sonny1.gif
search record by keyword - Sonny_VER1.rar (21.89 KB)
ss

¦^´_ 1# sunnyso


    ®¼§®ªºªF¦è¡Aªº½T¬O¦³³Ð·Nªº·Qªk
¦r¨å¨â¦U¦r ÁÙ¯uÃø²z¸Ñ

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2013-5-13 07:01 ½s¿è
Cells.ClearContent¨Ã¤£·|IJ°Ê worksheet_change
sunnyso µoªí©ó 2013-5-12 22:25

§A¼gªº¤º®e¯uªº«Ü¤£¿ù¡A¤]ÆZ¦³ºc«äªº¡C GBKEE ªº¸É¥R¤]ÆZ¨ãÅé¹ê¥Î¡C
¤£¦n·N¬O¡B¸É¥R¤@¤U§Ú«üªº¬O¬õ¦âªº Cells(4, 1) = ""¡A¦Ó«D   
Cells.ClearContent¡A¦]¬°¦b¤@¶}©l©Ò¦³¤º®e§¡³Q²M°£±¼¤F¡A
¤§«á·í  Cells(4, 1) ¡B Cells(4, 2)¡B Cells(4,3)¡B Cells(4, 4)¡B
©ÎªÌ¬O Cells(4, 5) ¤º®e¤¤¦³©Ò¥ô¦ó¤@²Õ²§°Ê®É¡A«K·|IJµo
worksheet_change()¡C

TOP

¦^´_ 9# GBKEE

·PÁÂGBKEE¤j¤jªºcode, ®Ä²v§ó°ª
¦³¤@ÂI¤p¤pªº¦a¤è¡A´N¬O¦pªGdatasheet(i) ªºAÄæ³Ì«á¤@¦C°²¦p¦]爲¿é¤J¿ù»~¬°ªÅ¥Õ·|¥X¿ù
¦pªG§â
    Cells(Rows.Count, "A").End(xlUp).Row
§ï爲
    UsedRange.Rows.Count
¦n¹³¥i¥HÁקK¡C¤£ª¾¹D³o¼Ë§ï§´·í¶Ü¡H
ss

TOP

¥»©«³Ì«á¥Ñ sunnyso ©ó 2013-5-12 22:34 ½s¿è
Cells.ClearContent¨Ã¤£·|IJ°Ê worksheet_change
sunnyso µoªí©ó 2013-5-12 22:25

¦^´_ 7# c_c_lai

¹ï¤£°_¨S¦³¼g§¹´N«ö¿ùÁä
Cells.ClearContent¨Ã¤£·|IJ°Ê worksheet_change
¥ÎCells(4,1)=¡§¡¨, ¨ÓIJ°Ê§ó¦³®Ä²v.
ÁÂÁÂ.
ss

TOP

¦^´_  sunnyso
Private Sub Worksheet_Activate()
    ' ....
    ' ....
    Cells.ClearContent ...
c_c_lai µoªí©ó 2013-5-12 19:54


Cells.ClearContent¨Ã¤£·|IJ°Ê worksheet_change
ss

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-5-12 21:36 ½s¿è

¦^´_ 5# sunnyso
§Aªºµ{¦¡§ï¥Î¦Û°Ê¿z¿ï ¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Private Sub Worksheet_Activate()
  3.     Dim Sh As Worksheet, E As Integer
  4.     Application.ScreenUpdating = False
  5.     Application.EnableEvents = False
  6.     AutoFilterMode = False
  7.     E = Cells(Rows.Count, "A").End(xlUp).Row
  8.     E = IIF(E = 5, 6, E)
  9.     Range("A6:E" & E).Clear
  10.     For Each Sh In Sheets(Array("DataSheet2", "DataSheet3", "DataSheet3"))
  11.         Sh.UsedRange.Offset(1).Copy Cells(Cells(Rows.Count, "A").End(xlUp).Row + 1, "A")            '¦X¨Ö¸ê®Æ
  12.     Next
  13.     E = Cells(Rows.Count, "A").End(xlUp).Row
  14.     Range("A5:E" & E).AutoFilter                '½d³ò³]¥ß,¦Û°Ê¿z¿ï.
  15.     For E = 1 To 5
  16.         Range("A5").AutoFilter E, , , , False   '¦Û°Ê¿z¿ï: ¨ú®ø½bÀY
  17.     Next
  18.     Application.EnableEvents = True
  19.     Application.ScreenUpdating = True
  20. End Sub
  21. Private Sub Worksheet_Change(ByVal Target As Range)
  22.     Dim M As Variant
  23.     Application.EnableEvents = False
  24.     If Target.Row = 4 And Target.Column <= 5 Then
  25.         M = Split(Target, "#")
  26.         If UBound(M) >= 1 Then   '
  27.            '¦Û°Ê¿z¿ï: ¦bÃöÁä¦rµü«e¥[¤J¡i#¡j±N¥HOR¨Ó¿z¿ï¸ÓÄæ¡C
  28.             Range("A5").AutoFilter Target.Column, "=*" & M(0) & "*", xlOr, "=*" & M(1) & "*"
  29.         Else
  30.             Range("A5").AutoFilter Target.Column, "=*" & Target & "*"
  31.         End If
  32.     End If
  33.     Application.EnableEvents = True
  34. End Sub
  35. Private Sub Worksheet_SelectionChange(ByVal Target As Range)  '²Ä4¦C¿é¤J«áªð¦^²Ä4¦C
  36.     Application.EnableEvents = False
  37.     If Target.Row = 5 And Target.Column <= 5 Then
  38.         Selection.Offset(-1).Select         'Target.Offset(-1).Select
  39.     End If
  40.     Application.EnableEvents = True
  41. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 6# ML089

1. ³]¸mªíÀY®æ¦¡ (¨£¤U¹Ï)

2. «Ü¦nªº«Øij, ¦³®É¶¡¦A§@­×§ï

3. ¥Ñ©ó¬YºØ¯S®í±¡ªp¤U, ¤£¯à¨Ï¥Î¦³¥¨¶°ªºÀÉ®×, ©Ò¥H¤~³]­p¸Ó¤è®×, ©ñ¤W¨Ó¸ò¤j®a¤À¨É.

sonny2.gif
ss

TOP

¦^´_  sunnyso

¼gªº¤£¿ù¡Aºc·Q¤]¤£¿ù

¦pªG¤@¶}©l¨S¦³¿z¿ïÃöÁä¦r®É¡A¦p¦ó§ï¬°¥þ³¡Åã¥Ü

¥Ø«e¤@¦CÃö ...
ML089 µoªí©ó 2013-5-11 09:19

¦^´_ 3# sunnyso
Private Sub Worksheet_Activate()
    ' ....
    ' ....
    Cells.ClearContents
    ' ....
    ' ....
    ' ....
    Next
    '  ³]©wµL¿z¿ïÃöÁä¦r¿é¤J¡A¨C¦¸±Ò°Ê¸Ó­¶­±§YÅã¥Ü¥þ³¡¤º®e
    '  ¥H¤UNull("")«Å§i¡A¨t²Î·|¦Û°ÊIJµoWorksheet_Change()
    Cells(4, 1) = ""   
    Application.ScreenUpdating = True
End Sub

TOP

¦^´_ 5# sunnyso

>1. ¦bAAÄæ³]­pªíÀYªº¦r«¬»PÃC¦âµ¥ (VBA Sheet)
¨S¦³¸Õ¦¨¥\

>2. ²K¥[VBA OR¿z¿ï¡A¦bÃöÁä¦r«e¥[#
³o³¡¤À¥Îªº¦³ÂI¤£¶¶
¦p¯à¹³°ª¶¥¿z¿ï¤è¦¡¤ñ¸û²³æ¡A¦P¤@¦C¬°AND¡A¤£¦P¦C¬°OR
VBA¥i¥H¦A¦P¤@¦C¥H ";" °Ï¤À¬°¤£¦P¦C¤è¦¡¡A
¨Ò¦p
¤p¶µ=¦­;¤È¡AS=A ªí¥Ü¨ú¥X OR(AND(¤p¶µ=¦­,S=A), AND(¤p¶µ=¤È,S=A))
¤p¶µ=¦­;¤È¡AS=A;B ªí¥Ü¨ú¥X OR(AND(¤p¶µ=¦­,S=A), AND(¤p¶µ=¤È,S=B))

>3. ²K¥[«DVBA¤èªk¡A·í¤¤¨S¦³¨Ï¥Î°}¦C©M°}¦C¨ç¼Æ¡]¦psmall, minµ¥¡^¡A¥H¤ÎºÉ¶qÁקK¨Ï¥ÎIF¨ç¼Æ¡]¦]¦¹¿z¿ï«áªº¸ê®Æ¶¶§Ç¬O3­Ósheets¥æ¿ù¡^¡C¥H§K¸ê®Æ¼W¥[·|¥O­pºâ¹Lªø¡C
¤½¦¡¤j·§¥u¯à³o¼Ë°µ¡A¥þ³¡¥ý¤Þ¥Î¹L¨Ó¿z¿ï   


¥H«e¥Î¥¨¶°½m²ß¹L¦¹Ãþ°ÝÃD¡A¬Ý§A¨Ï¥ÎVBA¨Ó³B²z©Ò¥H¯S§O¦³¿³½ì¡C¦pªG§A²Ö¤F¤£¥ÎºÞ§Úªº»Ý¨D¡CÁÂÁÂ
¥H«e¬O¤À¸Ñ°Ê§@
1. ±N¦USheets¸ê®Æ½Æ»s¦A¤@°_
2. ¤W¤è¹w¯d¤­¦æ¥Î°ª¯Å¿z¿ï¤è³B²z¡A¸ê®Æ¶ñ§¹«á«ö¶s¥Ñ¥¨¶°¨Ó±Ò°Ê°ª¯Å¿z¿ï(¥b¦Û°Ê¤è¦¡)
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

        ÀR«ä¦Û¦b : °µ¸Ó°µªº¨Æ¬O´¼¼z¡A°µ¤£¸Ó°µªº¨Æ¬O·Mè¡C
ªð¦^¦Cªí ¤W¤@¥DÃD