Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default remove the row value in the pivot table creation code.

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default remove the row value in the pivot table creation code.

last row in column H

set rng = Cells(rows.count,8).End(xlup)
msgbox rng.row

--
Regards,
Tom Ogilvy

"monika" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot Table Help -filter with creation date Sam Excel Worksheet Functions 0 May 15th 11 10:59 AM
Pivot table creation from another pivot table in 2007 Roger Excel Discussion (Misc queries) 0 August 4th 09 10:52 PM
Pivot table creation in excel NRCan13 Excel Worksheet Functions 1 October 1st 08 02:07 PM
pivot table creation procedures PIVOT TABLE Excel Discussion (Misc queries) 1 July 2nd 08 08:40 AM
code for creation of multiple pivot tables John C[_5_] Excel Programming 1 November 19th 03 02:20 AM


All times are GMT +1. The time now is 09:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"