advanced help
per page, with , order by , clip by
Results of 1 - 1 of about 13168 for 日付 (0.003 sec.)
[[20230421095111]]
#score: 2423
@digest: 5a14b3349e2fa191fcadcf030297c50e
@id: 94073
@mdate: 2023-04-21T08:38:01Z
@size: 2452
@type: text/plain
#keywords: cpdate (29072), 20230401 (20721), 20230403 (13911), る:" (7748), msg1 (6922), msg2 (5971), mydate (5348), 災報 (4059), 火災 (3922), 報知 (3673), 知器 (3578), タ例 (3381), 例20 (2452), datevalue (1918), 把握 (1753), yyyymmdd (1710), ・20 (1672), 合等 (1653), 定() (1582), 理内 (1210), アラ (1160), 日付 (1070), cdate (999), format (976), excel2021 (911), 存在 (901), 握し (894), isdate (851), ・デ (739), 行後 (719), ・マ (708), str (634)
日付ごとに出しているデータにて、全ての日付が存在するかを確認』(さき)
こんにちは。 対象のシートにて、日付ごとに集計したデータがあります。 【条件】 ・データがない場合でも日付はすべて存在するようにしたいです。 ・日付が存在した場合でも数値が0の場合を把握したい ・マクロ実行後、日付が抜けている行と、0が存在している行を別シートかアラートで把握したい ■データ例 20230401 1 2 3 20230403 0 1 3 ■把握したい内容 ・20230402が抜けている ・20230403に0のデータが含まれている ややこしいですが、このようなマクロを作成できますでしょうか。 < 使用 Excel:Excel2021、使用 OS:Windows10 > ---- いまいち処理内容がわかりませんが 最初に確認を セルA1 に ■データ例の 20230401 が入っているとして それは日付けではない気がしますが...後々大丈夫なのでしょうか? Sub 日付かどうか判定() Dim str As String, data As Date '' str = "20230401" str = [A1] If IsDate(str) Then data = CDate(str) Else MsgBox "日付ではありません" End If End Sub (あみな) 2023/04/21(金) 10:25:13 ---- この方が、わかりやすいかな? '2023/04/01 に変更すれば、どうなるかテスト Sub 日付かどうか判定2() Dim data As Date If IsDate(Range("A1")) Then data = CDate(Range("A1")) MsgBox "日付と認識しましたよ" Else MsgBox "日付ではありません" End If End Sub (あみな) 2023/04/21(金) 10:33:58 ---- Dim msg1 As String Dim msg2 As String Dim myDate As Long Dim cpDate As Long Dim i As Long, j As Long myDate = DateValue((Format(Cells(1, 1).Value, "####/##/##"))) - 1 For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row cpDate = DateValue((Format(Cells(i, 1).Value, "####/##/##"))) If cpDate > myDate Then Do While cpDate > myDate + 1 myDate = myDate + 1 msg1 = msg1 & vbCrLf & Format(myDate, "yyyymmdd") Loop For j = 2 To Cells(i, Columns.Count).End(xlToLeft).Column If Cells(i, j).Value = 0 Then msg2 = msg2 & vbCrLf & Format(cpDate, "yyyymmdd") Exit For End If Next End If myDate = cpDate Next If msg1 <> "" Then MsgBox "抜けている:" & msg1 End If If msg2 <> "" Then MsgBox "0のデータが含まれている:" & msg2 End If A列の値が空白の場合等にエラーになります。 (火災報知器) 2023/04/21(金) 10:40:48 ---- 皆さんありがとうございます、 火災報知器さん確かにできました! (さき) 2023/04/21(金) 17:38:01 ...
https://www.excel.studio-kazu.jp/wiki/kazuwiki/202304/20230421095111.txt - [detail] - similar
PREV NEXT
Powered by Hyper Estraier 1.4.13, with 97065 documents and 608341 words.

訪問者:カウンタValid HTML 4.01 Transitional