0
     Private Sub CommandButton1_Click()
       Dim rTable                 As Range
           Dim lRow                   As Long


        Set rTable = Sheets("Revenue Dashboard").PivotTables("PivotTable6").TableRange1
            With Sheets("Overall Dashboard")
         lRow = Application.Max(.Cells(.Rows.Count, "T").End(xlUp).Row + 1, 63)
       .Range("T" & lRow).Value = rTable.Cells(rTable.Cells.Count).Value
        .Select
       End With
        End Sub




    Private Sub CommandButton2_Click()
    Dim rngInput As Range
       Set rngInput = Sheet1.Range("R63:T69") '
        rngInput.ClearContents
     End Sub


        Private Sub CommandButton3_Click()
        Dim rTable                 As Range
        Dim lRow                   As Long


        Set rTable = Sheets("Impression      Dashboard").PivotTables("PivotTable5").TableRange1
       With Sheets("Overall Dashboard")
          lRow = Application.Max(.Cells(.Rows.Count, "T").End(xlUp).Row + 1, 127)
          .Range("T" & lRow).Value = rTable.Cells(rTable.Cells.Count).Value
            .Select
     End With
       End Sub


         Private Sub CommandButton4_Click()
          Dim rngInput As Range
         Set rngInput = Sheet1.Range("R127:T137") '
         rngInput.ClearContents
      End Sub


       Private Sub CommandButton5_Click()
       Dim rTable                 As Range
      Dim lRow                   As Long


       Set rTable = Sheets("Clicks Dashboard").PivotTables("PivotTable8").TableRange1
       With Sheets("Overall Dashboard")
  lRow = Application.Max(.Cells(.Rows.Count, "S").End(xlUp).Row + 1, 197)
  .Range("S" & lRow).Value = rTable.Cells(rTable.Cells.Count).Value
   .Select
       End With
       End Sub


        Private Sub CommandButton6_Click()
        Dim rngInput As Range
          Set rngInput = Sheet1.Range("Q197:T207") '
           rngInput.ClearContents


         End Sub


      Private Sub CommandButton7_Click()
      Dim slcr As SlicerCache


        For Each slcr In ActiveWorkbook.SlicerCaches

     slcr.ClearManualFilter
    Next slcr
            End Sub

これは、さまざまなデータ セットの一連の比較ボタンのコードで、それぞれに「データのクリア」ボタンがあります。最後に、最後に「スライサーのクリア」ボタンがあります。

以前は機能していましたが、ボタンを数回クリックした後、セル T63 にデータが表示されなくなりました (コマンド ボタン 1 の場合)。

私の知る限り、コードは変更されていません - 問題の原因は何ですか?

ありがとう

4

1 に答える 1

0

このステートメントに列参照を含めるべきではありませんか? コード:

       rTable.Cells(rTable.Cells.Count).Value
于 2013-05-25T10:23:44.790 に答える