none
Pivot table macro RRS feed

  • Question

  • Hi,

    Very simple question.

    I have a data in sheet 2 which filters and paste on sheet 3 by macro and the next step is it applies a pivot table to this data (Sheet 3).

    Now the problem here is that sometimes there is no new data come in hence the sheet 3 has only headers but no data. Since I have recorded macro to apply pivot table to this sheet, it gives me an error.

     

    I want a message box which will tell me that there is no data in the excel sheet and still run the macro without interupption.

     

    Can anyone help me with this I would really appreciate your help.

     

    Thanks,

    Sandeep 

    Sunday, August 28, 2011 1:50 PM

All replies

  • Are you saying that the macro is not an explicit code in Visual Basic module, but a 'project macro'?

    If so, transform the macro to vb code and implement the control with which you verify that sheet3 has or not lines to work with. Then set a macro to execute this code (if you need to use a 'project macro' instead to assign a function) 


    please, mark this as answer if it is THE answer
    ----------------
    Diego Cattaruzza
    Microsoft MVP - Visual Basic: Development
    blog: http://community.visual-basic.it/Diego
    web site: http://www.visual-basic.it
    Sunday, August 28, 2011 2:40 PM