[表示 : 全て 最新50 1-99 101- 201- 301- 401- 501- 601- 701- 801- 901- 2chのread.cgiへ]
Update time : 06/04 11:41 / Filesize : 289 KB / Number-of Response : 962
[このスレッドの書き込みを削除する]
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧] [類似スレッド一覧]


↑キャッシュ検索、類似スレ動作を修正しました、ご迷惑をお掛けしました

●EXCEL・VBA質問スレ Part2●



78 名前:デフォルトの名無しさん [2007/06/01(金) 14:15:30 ]
>>76
どっちの整理番号を残すとかは考えずにいきます.
このスレ的には問題あるかもしれないけど,一応動くので.
Private Sub Sample()
Dim targetCell As Range
Dim date1 As Date,date2 As Date,date3 As Date
Dim intervalMin As Integer

Set targetCell = Range("B1")  ←最初に日付が入っているセル
Do Until targetCell.Cells(2,1)=""
 date1=targetCell+CDate(targetCell.Cells(1,2))
 date2=targetCell.Cells(2,1)+CDate(targetCell.Cells(2,2))
 interval = DatePart("n",date2-date1)
 If interval=0 Then
  Rows(targetCell.Cells(2,1).Row).Delete
  ElseIf interval>10 Then
   Rows(targetCell.Cells(2,1).Row).Insert
   date3=DateAdd("n",10,date1)
   targetCell.Cells(2,1)=Format(date3,"yyyy/M/d")
   targetCell.Cells(2,2)=Format(date3,"hh:mm")
 End If
 Set targetCell=targetCell.Cells(2,1)
Loop
End Sub






[ 続きを読む ] / [ 携帯版 ]

全部読む 次100 最新50 [ このスレをブックマーク! 携帯に送る ] 2chのread.cgiへ
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧]( ´∀`)<289KB

read.cgi ver5.27 [feat.BBS2 +1.6] / e.0.2 (02/09/03) / eucaly.net products.
担当:undef