#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 67
Default 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?


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 527
Default 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?


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
Imported Oracle Data S. Kissing Excel Discussion (Misc queries) 0 November 16th 07 08:16 PM
Imported data buzz Excel Worksheet Functions 2 October 17th 07 11:51 PM
DB4 imported data Sasha[_2_] Excel Discussion (Misc queries) 3 August 17th 07 10:32 AM
imported data isn't in columns Brendan Excel Discussion (Misc queries) 2 January 25th 07 01:27 PM
Templates for Imported data Michael H Excel Worksheet Functions 0 January 24th 05 12:09 PM


All times are GMT +1. The time now is 10:35 AM.

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"