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

[µo°Ý] (Àu¤Æ)½Ð°Ý¦p¦ó¹ïÀ³Äæ¦ì(¤º®e¬°¤½¦¡)¡A±N­È¶K¤W?

[µo°Ý] (Àu¤Æ)½Ð°Ý¦p¦ó¹ïÀ³Äæ¦ì(¤º®e¬°¤½¦¡)¡A±N­È¶K¤W?

¥»©«³Ì«á¥Ñ edmondsforum ©ó 2022-7-22 00:21 ½s¿è

¦U¦ì¤j¤j¦n¡A
§Ú¤µ¤Ñ´Á±æªº ®×¥ó¶i«×¤u§@ªí ¬O¡G
¨C¤Ñ¥u­n§Ú¼g§¹¦U®×ªº "¥»¶gºK­n" ¤U­±ªº¤º®e«á¡A
·í§ÚÀx¦sÃö³¬«á¡A¥L´N·|¹B¦æVBA¡A
®Ú¾Ú§Ú«ü©wªº°Ï¶¡¤é´Á¡A¹ïÀ³¤W¸ÓÀx¦s®æ¤º®e·j´M«á¡A±N "¥»¶gºK­n" ¸ÓÄæ¤U¦Cªº¤º®eª½±µ ¶K¤W¡C
¥H¹F¨ì¯à°O¿ý¨ì¤µ¦~«×¨C¶gªººK­n¡ã

¦p¤U¹Ï©Ò¥Ü



²³æ¨Ó»¡
´N¬O¯à°÷ ¨C¤Ñ§ÚÃö³¬Àɮ׫ᠠ¯à¦Û°Ê¹B¦æ
±NG5:G3003 ªº¤º®e¡A®Ú¾ÚG4ªº¤º®e¡A¥h¬d§äAF4:CM4
¦pªG§ä¨ì¤F¡A´N±N¨ä¤º®e¶K¤W¡A
¨Ò¦p ¤W­±¹Ï¤ù´N¬O  G4¤º®e=BI4¡A¦]¦¹G5:G3003 ªº¤º®e ´N¶K¨ì BI5:BI3003

§Ú¦Û¤v¤]¹Á¸Õ¼g¤@²Õ ´ú¸Õ¬Ý¬Ý
  1. Sub ·s¼W()

  2. For j = 32 To Sheets("test").UsedRange.Columns.Count '±q²Ä32Äæ¶}©l¨ì³Ì¥kÃä
  3.     If Cells(4, j) = Cells(4, 7) Then   'cells(1,1) ¥Nªí²Ä1¦C ²Ä1Äæ = A1 = cells(row¦C,columnÄæ)
  4.     t = 1
  5.         For jj = 5 To 3003
  6.             Cells(jj, j) = Cells(jj, 7)
  7.         Next jj
  8.         MsgBox "¤w°O¿ý¤µ¤Ñ ¤u§@ºK­n "
  9.         Exit For
  10.     End If
  11. Next j

  12. If t = 0 Then
  13.     MsgBox "¤é´Á¥i¯à¶]±¼¡A¾É­PµLªk¦Û°Ê°O¿ý ¤u§@ºK­n ¡A½Ð½T»{"
  14. End If

  15. End Sub
½Æ»s¥N½X
¸g¹L¤W­±´ú¸Õ¬O¥i¥H¶K¤W¥h¡A¦ý¦o¬O¤@­Ó¤@­ÓºCºC¶K...¾É­P³o3003¦C µ¥¤F§Ö10¤ÀÄÁ¦h
³o¼Ë¤U¨Ó§Ú´N¨S¿ìªk®É¶¡ §Ö³tÃö³¬Àx¦s°õ¦æVBA¤F QQ

¦A½Ð¦U¦ì¤j¤j¨ó§UÀu¤Æ

¥t¥~§Ú³oÃ䦳­Ó¤pºÃ°Ý¡A¦³¿ìªk³]¸m¤@­Ó«ö¶s¡A´NÅý¥L§Ö³t¸õ¨ì ¥k¤âÃä(AF4:CM4 ) ¹ïÀ³¥»¶gªº¤é´Á(G4)©O?

ªþ¤WÀÉ®×   ¶i«×ªí.zip (397.36 KB)   ¦A«ô°U¤j¤j¤F

¦^´_ 1# edmondsforum

½Ð´ú¸Õ¬Ý¬Ý¡AÁÂÁÂ

Sub test()
Dim Arr, T$, R&, C%, j%, ck%
With Sheets("test")
    R = .[g65536].End(3).Row
    If R < 5 Then MsgBox "µL¸ê®Æ": Exit Sub
    C = .UsedRange.Columns.Count
    T = .[G4]
    Arr = .Range(.[AF4], .Cells(4, C))
    For j = 1 To UBound(Arr, 2)
        If Arr(1, j) = T Then C = j + 31: ck = 1: Exit For
    Next
    If ck = 0 Then MsgBox "¤é´Á¥i¯à¶]±¼¡A¾É­PµLªk¦Û°Ê°O¿ý ¤u§@ºK­n ¡A½Ð½T»{": Exit Sub
    Arr = .Range(.[g5], .Cells(R, 7))
    .Cells(5, C).Resize(R, 1) = Arr
End With
End Sub

TOP

        ÀR«ä¦Û¦b : ¤Ñ¤W³Ì¬ü¬O¬P¬P¡A¤H¥Í³Ì¬ü¬O·Å±¡¡C
ªð¦^¦Cªí ¤W¤@¥DÃD