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

[µo°Ý] §Ú·Q¼g¨C­Ó¾÷ºØùØ¿ï¥X ©ÒÄݮƸ¹¤¤³Ì¤p¹ê»Ú¶i®Æªº¼Æ¦r

[µo°Ý] §Ú·Q¼g¨C­Ó¾÷ºØùØ¿ï¥X ©ÒÄݮƸ¹¤¤³Ì¤p¹ê»Ú¶i®Æªº¼Æ¦r

½Ð°Ý¤j¤j­Ì¡A¦pÀɮסA§Ú·Q¼g¨C­Ó¾÷ºØùØ¿ï¥X ©ÒÄݮƸ¹¤¤(´Áªì®w¦s+¹ê»Ú¶i®Æ)³Ì¤pªº¼Æ¦r¡A¸Ó¦p¦ó¼gVBAµ{¦¡½X??¡AÁÂÁÂ
½Ð¤j¤j¦^ÂЮɶKµ{¦¡½X
file.rar (101.87 KB)

¦^´_ 1# scjiao
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub EX()
  3.     Dim Rng(1 To 2) As Range, E As Range
  4.     Dim AR(), i As Integer
  5.     With Sheets("Sheet1")
  6.         Set Rng(1) = .Range("A6", .Range("A" & .Rows.Count).End(xlUp)).SpecialCells(xlCellTypeConstants)
  7.         'Ū¨ú¾÷Á`ªº½d³ò¦³¤å¦rªºÀx¦s»Õ
  8.     End With
  9.     ReDim AR(0 To Rng(1).Areas.Count, 1 To 4)
  10.     AR(0, 1) = "¾÷Á`"
  11.     AR(0, 2) = "®Æ¸¹"
  12.     AR(0, 3) = "´Áªì®w¦s"
  13.     AR(0, 4) = "¹ê»Ú¶i®Æ"
  14.     For i = 1 To Rng(1).Areas.Count
  15.         AR(i, 1) = Rng(1).Areas(i).Cells(1)
  16.         Set Rng(2) = Rng(1).Areas(i).Resize(, 2).Columns(2).SpecialCells(xlCellTypeConstants)
  17.             '¾÷Á`ªº½d³ò [²Ä2Äæ] ¦³¤å¦rªºÀx¦s»Õ
  18.             For Each E In Rng(2).Areas
  19.             If E.Range("b1") + E.Range("E5") < AR(i, 3) + AR(i, 4) Then
  20.             '"´Áªì®w¦s"+"¹ê»Ú¶i®Æ"
  21.                 AR(i, 2) = E.Cells(1)
  22.                 AR(i, 3) = E.Range("b1")   '¥HE.Cells(1)
  23.                 AR(i, 4) = E.Range("E5")
  24.             ElseIf AR(i, 2) = "" Then  '®Æ¸¹: °}¦C¤¸¯À=""
  25.                 AR(i, 1) = Rng(1).Areas(i).Cells(1)
  26.                 AR(i, 2) = E.Cells(1)
  27.                 AR(i, 3) = E.Range("b1")
  28.                 AR(i, 4) = E.Range("E5")
  29.             End If
  30.         Next
  31.     Next
  32.     Sheets("Sheet2").[A1].Resize(UBound(AR), UBound(AR, 2)) = AR    'Åã¥Ü
  33. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# GBKEE
ÁÂÁª©¥Dªº¼ö¤ß¦^µª¡A«D±`·PÁÂ~:)

TOP

¦^´_ 2# GBKEE
½Ð°Ýª©¥D¤j¤j
For Each E In Rng(2).Areas
next
Rng(2).Areas ¬O¤°»ò·N«ä§r?
E.range("b1")¤S¬O¤°»ò·N«ä§r?
¤£¦n·N«ä¡Aªì¾ÇªÌ

TOP

¦^´_ 4# scjiao
  1. Option Explicit
  2. Sub Ex()
  3.     Dim Rng As Range, i As Integer
  4.     Application.VBE.MainWindow.Visible = True
  5.     Application.VBE.Windows("§Y®É¹Bºâ").Visible = True
  6.     Set Rng = Range("A1:C1,A5:C5,A3:B4,A10:A15")
  7.     'Areas ÄÝ©Ê ¶Ç¦^ Areas ¶°¦X¡A¦¹¶°¦X¥Nªí¦h­«½d³ò¤¤ªº©Ò¦³½d³ò¡C°ßŪ¡C
  8.     For i = 1 To Rng.Areas.Count '¦h­«½d³òªº­Ó¼Æ
  9.         Stop  '«öF8°õ¦æ¤U¤@¨B
  10.         Debug.Print vbLf & Rng.Areas(i).Address
  11.         
  12.         '¥H Areas(i)¬°°ò·Çªº Range ª«¥ó¡A¸Óª«¥ó¥Nªí¤@­ÓÀx¦s®æ©ÎÀx¦s®æ½d³ò¡C
  13.         Debug.Print Rng.Areas(i).Range("A1").Address
  14.         Debug.Print Rng.Areas(i).Range("B1").Address
  15.         Debug.Print Rng.Areas(i).Range("C1").Address

  16.     Next

  17. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 5# GBKEE
«D±`·PÁª©¥Dªº¦^ÂСA¨º½Ð°Ý
For Each E In Rng(2).Areas
next
¨ä¤¤
E.range("b1")¬O¤°»ò·N«ä

ÁÂÁª©¤j

TOP

¦^´_ 6# scjiao
¥H E ¬°°ò·Çªº Range ª«¥ó¡A¸Óª«¥ó¥Nªí¤@­ÓÀx¦s®æ©ÎÀx¦s®æ½d³ò
»P 5# ªºµ{¦¡½X¹B¦æµ²ªG£¸¼Ë
  1. Option Explicit
  2. Sub Ex()
  3.     Dim Rng As Range, E As Range
  4.     Application.VBE.MainWindow.Visible = True
  5.     Application.VBE.Windows("§Y®É¹Bºâ").Visible = True
  6.     Set Rng = Range("A1:C1,A5:C5,A3:B4,A10:A15")
  7.     'Areas ÄÝ©Ê ¶Ç¦^ Areas ¶°¦X¡A¦¹¶°¦X¥Nªí¦h­«½d³ò¤¤ªº©Ò¦³½d³ò¡C°ßŪ¡C
  8.     For Each E In Rng.Areas  '¦h­«½d³òªº­Ó¼Æ
  9.         Stop  '«öF8°õ¦æ¤U¤@¨B
  10.         Debug.Print vbLf & E.Address        

  11.         '¥H E ¬°°ò·Çªº Range ª«¥ó¡A¸Óª«¥ó¥Nªí¤@­ÓÀx¦s®æ©ÎÀx¦s®æ½d³ò¡C
  12.         Debug.Print E.Range("A1").Address
  13.         Debug.Print E.Range("B1").Address
  14.         Debug.Print E.Range("C1").Address

  15.     Next
  16. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 7# GBKEE
ÁÂÁª©¤j¡A§Ú§¹¥þ¤F¸Ñ¤F¡A³Ì«á§Ú·Q°Ýªº¬O¨ä¤¤¤@¬qµ{¦¡½X
With Sheets("Sheet1")
Set Rng(1) = .Range("A6", .Range("A" & .Rows.Count).End(xlUp)).SpecialCells(xlCellTypeConstants)      'Ū¨ú¾÷Á`ªº½d³ò¦³¤å¦rªºÀx¦s»Õ
End With
¨ä¤¤.Range("A" & .Rows.Count).End(xlUp)).SpecialCells(xlCellTypeConstants) ¦¹specialcells(xlcellTypeConstants) °Ñ¼Æ¬O¥Nªí¤°»ò·N«ä

TOP

¦^´_ 8# scjiao
¨ì VBAµøµ¡ »¡©ú ¿é¤J SpecialCells ¬Ý¬Ý
ºÉ¶q¨ì »¡©ú ¤¤¿é¤J ºÃ°ÝªºÄÝ©Ê.¤èªk.¨ç¼Æ.·|¦h¤F¸ÑVBAªº
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 9# GBKEE

¶â¡AÁÂÁª©¥D

TOP

        ÀR«ä¦Û¦b : ¬°¦Û¤v§äÂǤfªº¤H¥Ã»·¤£·|¶i¨B¡C
ªð¦^¦Cªí ¤W¤@¥DÃD