remove the row value in the pivot table creation code.

M

monika

Hi...

I want to remove the row value in the pivot table creation
code. Like in the
below code...I want to replace the H185 by the whatever
last row that should
be actually there. How can I find out the same while
creating the pivot
table.

range("H2").Select
ActiveCell.FormulaR1C1 = "PL"
range("H3").Select
ActiveCell.FormulaR1C1 = "=RC"
range("H3").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-5]="""",R[-1]C,RC[-5])"
range("H3").Select
Selection.AutoFill Destination:=range("H3:H185"),
Type:=xlFillDefault
range("H3:H185").Select
Selection.NumberFormat = "0"

For creating the pivot table I used the macro.

Thanks
Monika
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top