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

vba - Rows¤ºÅܼÆÀ³¦p¦ó¼g

vba - Rows¤ºÅܼÆÀ³¦p¦ó¼g

¦U¦ì°ª¤â¤j®a¦n
  ÅÜ¼Æ [a2] = 84
Rows("100:144").Select  ­n§ï¼g¦¨
   Rows(" [a2]+16:[a2]+60).Select
¥¿½T¼gªk¬O¦p¦ó ? ½Ð«ü¾É ÁÂÁÂ1

¦^´_ 1# jim
  1. Sub Ex()
  2.     [A2] = 84
  3.     Rows(([A2] + 16) & ":" & ([A2] + 60)).Select
  4. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# c_c_lai
c_c_lai  ¦hÁÂ

TOP

c_c_lai °ª¤â
­Y¬O¦b  ÅܼƬ° [A2]=84
Set rng = Range([125:h250], [h65536].End(3))
[h125:h250] = ??¬O§_¥i§ï¼g¬° ?? [ H ?? [A2]+43: H??[A2]+166]

TOP

¦^´_ 4# jim
Set rng = Range([125:h250], [h65536].End(3)) ¡H¡H¡H
¤£¤Ó²M·¡§Aªºªí¹F¡C

TOP

c_c_lai  ¦hÁÂÃö·Ó
[h125:h250]
¦p¦P¤W ¥Î [a2]+43 ¥Nªí 125 ,[a2]+166 ¥Nªí 250
Set rng = Range([125:h250], [h65536].End(3))
  À³¦p¦ó§ï¼g

TOP

¦^´_ 6# jim
Set rng = Range([125:h250], [h65536].End(3))¡H
§Ú²q·Q§A¬O«ü
[A2] = 84
Set rng = Range(Range("H" & ([A2] + 41)),  [H65536].End(3))
¥Ø«eªº½d³ò­È¬°¡G H125:H###   
(°²³]  [H65536].End(3) ¦ì§}¬° H###)

TOP

¦^´_ 6# jim
ªþ¤W¤@­Ó¹ê°È½d¨Ò¡A¨Ñ°Ñ¦Ò¡G
  1. Sub ´«¤ë()
  2.     Dim cts As Integer, xs As Integer
  3.     Dim rng As Range, lDate As Date
  4.     Dim ¦~ As String, ¤ë As String
  5.    
  6.     With Sheets("XXXXXX")
  7.         For xs = 0 To 2
  8.             '  ±N H1:AL2¡BH18:AL19¡BH35:AL36 ½d³ò¤º¤§¸ê®Æ²MªÅ¡C
  9.             .Range("H" & (xs * 17 + 1) & ":AL" & (xs * 17 + 2)).ClearContents
  10.             '  ³]©w rng ¬° H1¡BH18¡B¥H¤Î H35 Äæ¦ì¡C
  11.             Set rng = .Range("H" & IIf(xs < 3, xs * 17 + 1, 63))
  12.             For cts = 1 To Day(DateSerial(¦~, ¤ë + 1, 0))      '  ¨ú±o¸Ó¤ë¤Ñ¼Æ
  13.                 rng.Offset(, cts - 1) = cts   
  14.                 '  H1¡BH18¡B¥H¤Î H35 Äæ¦ì­È¬°´X¸¹¡F¨Ã¨Ì§Ç©¹¥k©µ¦ù¡C
  15.                 lDate = DateSerial(¦~, ¤ë, cts)
  16.                 '  H2¡BH19¡B¥H¤Î H36 Äæ¦ì­È¬°¬P´Á´X¡F¨Ã¨Ì§Ç©¹¥k©µ¦ù¡C
  17.                 rng.Offset(1, cts - 1) = Right(WeekdayName(Weekday(lDate)), 1)
  18.             Next cts
  19.         Next xs
  20.     End With
  21. End Sub
½Æ»s¥N½X

TOP

c_c_lai  ÁÂÁÂ
§Úªº­ì·N¬O
Set rng = Range([h125:h250], [h65536].End(3))
¥i§_§ïÅܬ°
Set rng = Range("H" & ([A2] + 41:"H"& [A2] + 166), [h65536].End(3)).
¦¹»yªk¹ï¶Ü?

TOP

¦^´_ 9# jim
Set rng = Range("H" & ([A2] + 41:"H"& [A2] + 166), [h65536].End(3)).
À³¸Ó¬°
Set rng = Range(Range("H" & ([A2] + 41) & ":H" & ([A2] + 166)), [h65536].End(3))
°²³] [A2]] = 84¡A¨äµ²ªGªº½d³ò­È¬°¡G H125:H###  
¨âÂI¤§¶¡¨ú³Ì¤p¤Î³Ì¤j­È¡A¥Ñ¤U¹Ï§A«K·|ÁA¸Ñ¤F¡C

TOP

        ÀR«ä¦Û¦b : ¦n¨Æ­n´£±o°_¡A¬O«D­n©ñ±o¤U¡A¦¨´N§O¤H§Y¬O¦¨´N¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD