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

[µo°Ý] ¦p¦ó§Ö³t½Æ»s³Ñ¤U¨S³Q¿ï¦±ªº?

[µo°Ý] ¦p¦ó§Ö³t½Æ»s³Ñ¤U¨S³Q¿ï¦±ªº?

A1 B1 C1 D1  ¤À§O¬°  ½s¸¹  ³æ¦ì  ©m¦W  Â¾ºÙ
¸ê®Æµ§¼Æ¤£©w
¤@¯ë®Ö¹ï¸ê®Æ®É³£¬O§â§Ú¾Ö¦³ªº¿ï¨ú~
§ä¥X³Ñ¤U¨S³Q¿ï¨úªº~

§Ú¸Ó¦p¦ó§Ö³t½Æ»s³o¨Ç³Ñ¤U¨S³Q¿ï¦±ªº©O?
¦]¬°¸g±`¨Ï¥Î~¨C¦¸³£¥²¶·¿é¼gµù°O¦b¿ï¨ú³o¨Ç¨S³Q¿ï¨úªº~
«D±`³Â·Ð~½Ð±Ð¦U¦ì¤j¤j¤F

¦^´_ 1# av8d
¬O¤£¬O³o­Ó·N«ä?
  1. Private Sub CommandButton1_Click()
  2.     Dim Rng, rngE As Range, row1 As Integer
  3.     end1 = [A65536].End(xlUp).Row
  4.     Set rngE = [E2].Resize(end1, 1)
  5.     For Each Rng In rngE
  6.         If Rng = "" Then
  7.             Cells(Rng.Row, 1).Resize(1, 4).Copy
  8.             row1 = [I65536].End(xlUp).Offset(1, 0).Row
  9.             Cells(row1, 9).Resize(1, 4).Select
  10.             ActiveSheet.Paste
  11.         End If
  12.     Next
  13. End Sub

  14. Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  15.     Dim rngE As Range
  16.     end1 = [A65536].End(xlUp).Row
  17.     Set rngE = [E1].Resize(end1, 1)
  18.     If Not Intersect(Target, rngE) Is Nothing Then
  19.         If Target = "v" Then
  20.             Target = ""
  21.         Else
  22.             Target = "v"
  23.         End If
  24.     End If
  25. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# yen956


    ¤Ó¯«°Õ!
§Ú·Q¸ß°Ý¤@¤U~¦pªG§Ú·Q­×§ï¦¨½Æ»s¿ï¨úªº~¸Ó¦p¦ó§ï?
§Ú¥ý¬ã¨s¤@¤U~¦A¦¸·PÁÂ

TOP

¥»©«³Ì«á¥Ñ yen956 ©ó 2014-3-12 17:44 ½s¿è

¸É¥R»¡©ú¡G
¦bVBA½s¿è¾¹¤¤, Double Click ¥ªÃ䪺 "sheet1"...µ¥,
·|¥X²{ ªÅ¥Õ½s¿èµøµ¡,
«ö¤U ªÅ¥Õ½s¿èµøµ¡ ¥¿¤W¤èªº ¤U©Ô¦¡¿ï³æ, ¿ï¨ú "Worksheet",
¥kÃ䪺 ¤U©Ô¦¡¿ï³æ ¤¤, ¿ï¨ú "SelectionChange",
´N·|¦Û°Ê¸õ¥X:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
End Sub
¤§«á§A¦b "sheet1"... ¦p¦³ SelectionChange ªº°Ê§@,
´N·|IJ°Ê¦¹°Æµ{¦¡, ¨Ã±N Cell ªþ¤© Target,
¨Ò¦p±q A1 ²¾¨ì B2, «h Target=A1, ¨Ã¹ï¾ã±i Worksheet ¦³®Ä,
¦ý Intersect(Target, rngE) ¥i±N SelectionChange
ªº¦³®Ä½d³ò­­¨î¦b rngE ¤¤,
    If Not Intersect(Target, rngE) Is Nothing Then
    End If
Not Intersect(Target, rngE) Is Nothing¡÷­t­t±o¥¿
¡÷ªí¥Ü Target ¨Ã«D Nothing.

TOP

¦^´_ 3# av8d
¤j¤j§A¦n, ¤°»ò¥s¡i½Æ»s¿ï¨ú¡j?
¥i¤£¥i¥HÁ|¨Ò(©ÎªþÀÉ)»¡©ú.

TOP

¦^´_ 4# yen956
¹ï¤£°_, §Ë¿ù¤F!!
¿ù»~:
¨Ò¦p±q A1 ²¾¨ì B2, «h Target=A1, ¨Ã¹ï¾ã±i Worksheet ¦³®Ä,
§ó¥¿:
¨Ò¦p±q A1 ²¾¨ì B2, «h Target=B2, ¨Ã¹ï¾ã±i Worksheet ¦³®Ä,

TOP

¥»©«³Ì«á¥Ñ av8d ©ó 2014-3-14 10:27 ½s¿è

¦^´_ 5# yen956


    956¤j¤j~¯u¤£¦n·N«ä~³Ìªñ¤ñ¸û¦£¨º»ò±ß¤~¦^Âбz~
§Ú§âºÃ°Ý¤@¤@¦C¥X

1.«D¥´¤Äªº½Æ»s~§ï¦¨¥´¤Äªº½Æ»s~¸Ó¦p¦ó§ï¼g
´ú¸ÕOK
If Rng = "v" Then

2.¦pªG­n½Æ»s¨ìJ¨ìMÄæ~¸Ó¦p¦ó¼g
3.¦pªG­n½Æ»s¨ìSheet3~¸Ó¦p¦ó¼g
4.¦pªGEÄæ§ï¦¨FÄæ~¸Ó¦p¦ó§ï¼g
5.¦pªG¥u­n½Æ»sB©MDÄæ~¸Ó¦p¦ó§ï¼g

6.¦pªG¥u­n½Æ»sB¨ìDÄæ~¸Ó¦p¦ó§ï¼g
´ú¸ÕOK
Cells(Rng.Row, 2).Resize(1, 4).Copy

¦pªG¤è«Kªº¸Ü¥i§_¸Ñ»¡Ãö©óPrivate Sub CommandButton1_Click()¤º®e~ÁÂÁÂ

TOP

¦^´_ 7# av8d


    ³Ñ¤U°ÝÃD3
­n½Æ»s¨ìSheet3ªºB2

TOP

¦^´_ 8# av8d
¸Õ¸Õ¬Ý:
Private Sub CommandButton1_Click()
    Dim Rng, rngE As Range, row1, i As Integer
   
    Dim sh1, sh3 As Object
'   Set sh1 = ThisWorkbook.Sheets("Sheet1")
    Set sh3 = ThisWorkbook.Sheets("Sheet3")

   
    end1 = [A65536].End(xlUp).Row
    Set rngE = [E2].Resize(end1, 1)
    i = 2
    sh3.Activate

    For Each Rng In rngE
        If Rng = "v" Then
            Cells(Rng.Row, 1).Resize(1, 4).Copy
            sh3.Cells(i, 2).Select
'            row1 = [I65536].End(xlUp).Offset(1, 0).Row
'            Cells(row1, 9).Resize(1, 4).Select
            ActiveSheet.Paste
            i = i + 1
        End If
    Next
End Sub

TOP

¦^´_ 9# yen956


    ¤j¤j~ÁÂÁ§A~¤Ó¼F®`¤F~

§Ú·Q¦A°Ý¤@­Ó°ÝÃD~³o°ÝÃD¨S¸Ñ¶}¨SÃö«Y~
¦]¬°¦³ÂI½ÆÂø~¦³¨ÇÃø«×~
°ÝÃD¤@¡G
¦pªG­n½Æ»s¨ì¥kÃä¤S­n½Æ»s¨ìSheet3¨âºØ³£­n¦³¸Ó¦p¦ó°µ©O?

°ÝÃD¤G(¶i¶¥ÃD)¡G
¦pªG
§â¥´¤Äªº¦a¤è§ï¦¨
­ì¥»A,B,C,D,¥´¤Ä
§ï¦¨A,B,¥´¤Ä,C,D
¦ì¸m§ó°Ê¡A³o¼Ë¦ü¥G·|¤ñ¸û¤è«K¨Ï¥ÎªÌ~¦ý¬O·|ÅýÅܱo¤£¦n¼g~

¦A¦¸³Â·Ð¤j¤j~ÁÂÁÂ

TOP

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