LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Simple loop in macro

Can someone please help me.

I'm trying to write a script which will go to adjacent cells in row 6
of a PivotTable and replace the existing text with text located in
adjacent cells in a row at another location.

I can achieve this with the following code:

Range("B5").Select
ActiveSheet.PivotTables
("PivotTable1").PivotFields("Date").PivotItems_ ("4/12/2005 -
10/12/2005").Caption = "10/12/05"
Range("C5").Select
ActiveSheet.PivotTables
("PivotTable1").PivotFields("Date").PivotItems_("1 1/12/2005 -
17/12/2005").Caption = "17/12/05"
Range("C5").Select
ActiveSheet.PivotTables
("PivotTable1").PivotFields("Date").PivotItems_("1 8/12/2005 -
24/12/2005").Caption = "24/12/05"

However, I want to write this more efficiently using code which
successively increments each column reference in Row 6 and replacing
with the text in Row 100, where B100 = 10/12/05, C100 = 17/12/05, D100
= 24/12/05.

Can someone kindly help show me how this can be done?

Thanks, Simon

 
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
simple loop macro jim27[_4_] Excel Programming 1 October 17th 04 07:14 PM
simple loop macro jim27[_3_] Excel Programming 0 October 17th 04 06:40 PM
simple loop macro jim27[_2_] Excel Programming 0 October 17th 04 06:36 PM
simple loop macro jim27 Excel Programming 2 October 17th 04 06:28 PM
Probably missing something simple in loop macro...Please help Jules[_6_] Excel Programming 3 April 15th 04 05:16 AM


All times are GMT +1. The time now is 02:12 PM.

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

About Us

"It's about Microsoft Excel"