title: is it possible for VBA to detect the error and give a prompt that data not available instead of giving error message?
body: <p>I have created a GUI that will setup the pivot table.</p>
  
  <p>For example, I click <code>button1</code> it will run and setup the pivot table.</p>
  
  <p>When I click <code>button3</code>, it will have a <code>run time error 1004</code> because it does not have the value in the data. So is it possible to let VBA accept that error and show a prompt that that data is not available?</p>
  
  <p><img src="https://i.stack.imgur.com/mZi76.png" alt="enter image description here"></p>
  
  <p>By the way, I'm using this </p>
  
  <p><code>ActiveSheet.PivotTables("PivotTable1").PivotFields("Test").CurrentPage = "Data1"</code> </p>
  
  <p>to setup the pivot table.</p>
  
  <p>There are 3 different variables; <strong>Data1</strong>, <strong>Data2</strong>, <strong>Data3</strong>. If <strong>Data3</strong> is not available, it will show the error but I want to have a prompt to show that it is not available.. If you know how to do it, please share it with me! Thank you!</p>