|    | 
     ▼どじょりん さん: 
>マクロを実行した日を入力するマクロが実行できなくて困っています。   
> 
おはようございます。 
 
 
>Private Sub CommandButton1_Click() 
> 
>Dim Choice As Integer 
>Dim Msg1 As String 
>Dim Msg2 As String 
>Dim Msg3 As String 
>Dim i As Long 
>Dim j As Long 
> 
>Msg1 = "販売数に入力された数が台帳より削減されます。" 
>Msg2 = "数量がゼロになった物品は行ごと削除されます。" 
>Msg3 = "処理を続けますか?" 
> 
> 
>Choice = MsgBox((Msg1 & vbCrLf & Msg2 & vbCrLf & "" & vbCrLf & Msg3), vbYesNo + vbExclamation, ("注意")) 
>Select Case Choice 
> Case vbYes 
>  
>  With Sheets("台帳") 
>  .Select 
>  On Error Resume Next 
>  Range("A3:A65536").SpecialCells(xlCellTypeConstants).EntireRow.Copy 
>  End With 
>   
>  With Sheets("削除一覧") 
>  .Range("2:2").Insert 
>  .Columns("A:D").EntireColumn.AutoFit 
>   
>  End With 
> 
>  For i = 2 To Cells(Rows.Count, 1).End(xlUp).Row 
>   Sheets("削除一覧").Cells(i, 4) = Sheets("削除一覧").Cells(i, 1) 
>   Sheets("削除一覧").Cells(i, 1) = Format(Now(),"yyyy/mm/dd) 
>   Next 
> 
> 
>  With Sheets("台帳") 
>  .Select 
> 
> 
> For i = 3 To Cells(Rows.Count, 1).End(xlUp).Row 
> Cells(i, 4) = Cells(i, 4) - Cells(i, 1) 
> Next 
> 
> For i = 3 To Cells(Rows.Count, 1).End(xlUp).Row 
> Range(Cells(i, 1), Cells(i, 2)).ClearContents 
> Next 
> 
> For j = Cells(Rows.Count, 3).End(xlUp).Row To 3 Step -1 
> If Cells(j, 4).Value = 0 Then Cells(j, 4).EntireRow.Delete 
> Next 
>  
> End With 
> 
>Case vbNo 
>Sheets("台帳").Select 
> 
>  
>End Select 
>End Sub 
> 
> 
>このマクロの 
>「Sheets("削除一覧").Cells(i, 1) = Format(Now(),"yyyy/mm/dd)」 
記述ミス? ということですか? 
 
Sheets("削除一覧").Cells(i, 1).value = Format(Now(),"yyyy/mm/dd") 
プロパティは、しっかり記述する癖を付けてください。 
 
 
>の部分が上手くできず止まってしまいます。 
 
 | 
     
    
   |