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

[µo°Ý] Àx¦s®æ(¤é´Á)¬Û´î®É¥X²{"°õ¦æ¶¥¬q¿ù»~13"

[µo°Ý] Àx¦s®æ(¤é´Á)¬Û´î®É¥X²{"°õ¦æ¶¥¬q¿ù»~13"

µ{¦¡¤ùÂ_¦p¤U,

Private Sub CommandButton4_Click() '
  Dim sh4 As Worksheet, sh6 As Worksheet
  Dim l As Integer, FinalRow As Integer
  Set sh4 = Sheets("Sheet4")
  Set sh6 = Sheets("Sheet6")
  Application.ScreenUpdating = False
  FinalRow = sh4.Range("A" & Rows.Count).End(xlUp).Row '
      For l = 2 To FinalRow
          sh4.Cells(l, 9).Copy sh6.Cells(l, 4)
          sh4.Cells(l, 5).Copy sh6.Cells(l, 5)
          sh4.Cells(l, 2).Copy sh6.Cells(l, 6)
          sh6.Cells(l, 7) = sh6.Cells(l, 6) - sh6.Cells(l, 5)  <-----¿ù»~¥X²{¦b¦¹"°õ¦æ¶¥¬q¿ù»~13 «¬ºA¤£²Å¦X"
       Next
End sub
================
Sh6 E¦C¤ÎF¦C¬O¥ÑSH4 ½Æ»s¹L¨Ó, E &F ¦CÅã¥Üªº¬O¤é´Á¨Ò¦p 2016/02/01
·íÀx¦s®æÅã¥Üªº¤é´Á¬O2016/02/01 ³oºØ®æ¦¡µ{¦¡´N·|¥X²{"°õ¦æ¶¥¬q¿ù»~13"
­Y¬O±N¤w½Æ»sªºÀx¦s®æ¥Î·Æ¹«¥ªÁäÂI2¤U,¤é´ÁªºÅã¥Ü´N·|¥Ñ"2016/02/01"Åܦ¨"2016/2/1"
³oºØ®æ¦¡µ{¦¡´N¥i¥H¹B¦æ¥¿±`. ¦³¤°»ò¤è¦¡¦bCOPY®É¥i¥H¥ý±N¤é´ÁÅã¥Ü§ï¦¨³oºØ"2016/2/1",

[ MR-2.rar (29.08 KB)
¥[ªþ¥ó,SHEET3 ¬OERP¨t²ÎÂà¥X¨Óªº­ì©lÀÉ

TOP

¦^´_ 1# morris_lth
¸Õ¸Õ³o¼Ë
sh6.Cells(l, 7) = Datediff("d",CDate(sh6.Cells(l, 5)),CDate(sh6.Cells(l, 6)))
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

¥i¥H! ¤Ó¼F®`¤F~
¯à§_¸ÑÄÀ¤@¤U, ¬°¦ó±zªº¤è¦¡OK, §Ú­ì¦³ªº¤è¦¡´N·|¨ü­­©ó
¤é´Á®æ¦¡2016/02/01¥X²{¿ù»~,2016/2/1 ´N¯à¥¿±`?

TOP

¥»©«³Ì«á¥Ñ stillfish00 ©ó 2016-2-25 19:13 ½s¿è

¦^´_ 4# morris_lth
sh6.Cells(l, 6) => Range ª«¥ó
sh6.Cells(l, 5) => Range ª«¥ó
¨âª«¥óµLªk¬Û´î·|±Ä¥Î Rangeªº¹w³]ÄݩʧY.Value ¬Û´î
¬G·|ÅÜ¡@sh6.Cells(l, 6).Value - sh6.Cells(l, 5).Value

§A¥ÎTypeName¡]sh6.Cells(l, 6).Value¡^·|¶Ç¦^ String¡A
ªí¥Ü¡@sh6.Cells(l, 6).Value¡@¨ä¹ê¬O¦r¦ê¡C

¦r¦êµLªk¬Û´î(¦]¦¹²£¥ÍError)
©Ò¥H§Ú¥ÎCDate§â¦r¦êÂରDate¸ê®Æ«¬ºA
¨âµ§Date¨D¶¡¹j¡A¥ÎDateDiff¨Ó°µ¡A"d"ªí¥Ü­pºâ¶¡¹j³æ¦ì¬°"¤é"

¥t¤@ºØ¤èªk´N¬O¥ý³]©w¦nÀx¦s®æ®æ¦¡¬°¤é´Á¡A´N¤£·|»~§PÂ_¬°¦r¦ê¡C

¤é´Á®æ¦¡2016/02/01¥X²{¿ù»~,2016/2/1 ´N¯à¥¿±`?
§A¬Ý¬ÝÂI¨â¤UÅܬ°2016/2/1ªºÀx¦s®æ¡A¥kÁäÀx¦s®æ®æ¦¡¬O¤£¬OÅܤé´Á¤F¡H
1

µû¤À¤H¼Æ

    • ­ã´£³¡ªL: Ãø±oªº¨Î¸Ñ, ¸Ô¥H»¡©ú§ó¬OÃø±o!ª÷¿ú + 5
ªí¹F¤£²M¡BÃD·N¤£©ú½T¡B¨SªþÀɮ׮榡¡B¨S¦³°Q½×°ÝÃDªººA«×~~~~~~¥H¤W·R²ö¯à§U¡C

TOP

        ÀR«ä¦Û¦b : ¤f»¡¤@¥y¦n¸Ü¡A¦p¤f¥X½¬ªá¡F¤f»¡¤@¥yÃa¸Ü¦p¤f¦R¬r³D¡C
ªð¦^¦Cªí ¤W¤@¥DÃD