![]() |
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? |
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 |
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? |
All times are GMT +1. The time now is 11:27 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com