Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Excel vba loop?

i have the following pivot table;

TagName 18-Feb 19-Feb
PS001_Pump1.Daily_Runtime 4.20 3.90
PS001_Pump1.Daily_Starts 75 76
PS001_Pump2.Daily_Runtime 4.28 4.03
PS001_Pump2.Daily_Starts 74 76

what i would like to have it look like;

TagName 18-Feb 19-Feb
PS001_Pump1.Daily_Runtime 4.20 / 75 3.90 / 76
PS001_Pump2.Daily_Runtime 4.28 / 74 4.03 / 76

any ideas?



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Excel vba loop?

Sub macro1()
Dim iRow As Integer
Dim ws As Worksheet
Set ws = Sheets("Sheet1")
'change columns and initial iRow to suit
ws.Cells(1, 5) = ws.Cells(1, 1)
ws.Cells(1, 6) = ws.Cells(1, 2)
ws.Cells(1, 7) = ws.Cells(1, 3)
iRow = 2
Do Until ws.Cells(iRow, 1) = ""
ws.Cells(1 + iRow / 2, 5) = ws.Cells(iRow, 1)
ws.Cells(1 + iRow / 2, 6) = ws.Cells(iRow, 2) & "/" & ws.Cells(1 +
iRow, 2)
ws.Cells(1 + iRow / 2, 7) = ws.Cells(iRow, 3) & "/" & ws.Cells(1 +
iRow, 3)
iRow = iRow + 2
Loop
End Sub

Hth,
Merjet


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Excel vba loop?

In the source data, separate the pump identifier from the type of
information. then put the type of information is as one of your column
fields.

--
Regards,
Tom Ogilvy


"Mark J" wrote:

i have the following pivot table;

TagName 18-Feb 19-Feb
PS001_Pump1.Daily_Runtime 4.20 3.90
PS001_Pump1.Daily_Starts 75 76
PS001_Pump2.Daily_Runtime 4.28 4.03
PS001_Pump2.Daily_Starts 74 76

what i would like to have it look like;

TagName 18-Feb 19-Feb
PS001_Pump1.Daily_Runtime 4.20 / 75 3.90 / 76
PS001_Pump2.Daily_Runtime 4.28 / 74 4.03 / 76

any ideas?



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
For Each ... Next loop - need to reference the loop variable [email protected] Excel Programming 4 July 13th 06 06:12 PM
Advancing outer Loop Based on criteria of inner loop ExcelMonkey Excel Programming 1 August 15th 05 05:23 PM
Loop Function unable to loop Junior728 Excel Programming 1 July 28th 05 10:23 AM
Problem adding charts using Do-Loop Until loop Chris Bromley[_2_] Excel Programming 2 May 23rd 05 01:31 PM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM


All times are GMT +1. The time now is 08:11 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"