![]() |
Imported data
I have downloaded data from another program into excel. I want to put the
name and total hours worked on the same row. Here's how the data filled into the spreadsheet: Ann Mon 7.5 Tues 7.5 Wed 7.5 Total 22.5 Cathy Mon 7 Wed 8 Thurs 7 Total 22 But, I want it to look like this - Ann 22.5 Cathy 22 How do I do that? |
Imported data
If it is a daily task the eaiest way is to use a macro. id the data will
always be imported into the sames book copy the code into a VB Module (ALT + F11, Insert Module) Then return to the book (ALT Q) and run the code. If the data is imported into a new book the code will not be available unless you copy the code into your personal.xls Sub CondenseList() Dim LastRow As Long, i As Long, thisRow As Long Dim MyName As String LastRow = Cells.SpecialCells(xlLastCell).Row ' Place the Total by the names For i = 1 To LastRow If Not IsEmpty(Cells(i, 1)) Then MyName = Cells(i, 1) thisRow = i ElseIf Cells(i, 2).Value = "Total" Then Cells(thisRow, 2).Value = Cells(i, 3).Value End If Next ' Clear column 3 Range(Cells(1, 3), Cells(LastRow, 3)).ClearContents ' delete the redundant rows For i = LastRow To 1 Step -1 If IsEmpty(Cells(i, 1)) Then Range(Cells(i, 1), Cells(i, 2)).Delete End If Next End Sub Hope this helps Peter "Help" wrote: I have downloaded data from another program into excel. I want to put the name and total hours worked on the same row. Here's how the data filled into the spreadsheet: Ann Mon 7.5 Tues 7.5 Wed 7.5 Total 22.5 Cathy Mon 7 Wed 8 Thurs 7 Total 22 But, I want it to look like this - Ann 22.5 Cathy 22 How do I do that? |
All times are GMT +1. The time now is 07:20 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com