ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Remove useless information (https://www.excelbanter.com/excel-worksheet-functions/181553-remove-useless-information.html)

djaydida

Remove useless information
 
How can add all the numbers for a total, and only Keep in all in one line.
Example below, nubers totals 9, but i only need that with one name, one
address, one city, one state, and one phone #...I have a spreadsheet that
have been working on for two days.

1 Mark Roy 5642 N. Heatherstone Drive Shreveport LA 71129-4814 (864) 844-2812
2 Mark Roy 5642 N. Heatherstone Drive Shreveport LA 71129-4814 (864) 844-2812
1 Mark Roy 5642 N. Heatherstone Drive Shreveport LA 71129-4814 (864) 844-2812
1 Mark Roy 5642 N. Heatherstone Drive Shreveport LA 71129-4814 (864) 844-2812
1 Mark Roy 5642 N. Heatherstone Drive Shreveport LA 71129-4814 (864) 844-2812
2 Mark Roy 5642 N. Heatherstone Drive Shreveport LA 71129-4814 (864) 844-2812
1 Mark Roy 5642 N. Heatherstone Drive Shreveport LA 71129-4814 (864) 844-2812


Don Guillett

Remove useless information
 
try

Sub consolitateem()
Application.ScreenUpdating = False
Sheets("sheet8").Range("j1:k35").Copy Range("a1")
mc = 2 'col B
For i = Cells(Rows.Count, mc).End(xlUp).Row To 2 Step -1
If Cells(i - 1, mc) = Cells(i, mc) Then
mysum = Cells(i, mc - 1) + Cells(i + 1, mc - 1)
Rows(i + 1).Delete
Else
mysum = 0
End If
Cells(i, mc - 1) = mysum
Next i
Rows(2).Delete
Application.ScreenUpdating = False
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"djaydida" wrote in message
...
How can add all the numbers for a total, and only Keep in all in one line.
Example below, nubers totals 9, but i only need that with one name, one
address, one city, one state, and one phone #...I have a spreadsheet that
have been working on for two days.

1 Mark Roy 5642 N. Heatherstone Drive Shreveport LA 71129-4814 (864)
844-2812
2 Mark Roy 5642 N. Heatherstone Drive Shreveport LA 71129-4814 (864)
844-2812
1 Mark Roy 5642 N. Heatherstone Drive Shreveport LA 71129-4814 (864)
844-2812
1 Mark Roy 5642 N. Heatherstone Drive Shreveport LA 71129-4814 (864)
844-2812
1 Mark Roy 5642 N. Heatherstone Drive Shreveport LA 71129-4814 (864)
844-2812
2 Mark Roy 5642 N. Heatherstone Drive Shreveport LA 71129-4814 (864)
844-2812
1 Mark Roy 5642 N. Heatherstone Drive Shreveport LA 71129-4814 (864)
844-2812



Beege

Remove useless information
 
djaydida wrote:
How can add all the numbers for a total, and only Keep in all in one line.
Example below, nubers totals 9, but i only need that with one name, one
address, one city, one state, and one phone #...I have a spreadsheet that
have been working on for two days.

1 Mark Roy 5642 N. Heatherstone Drive Shreveport LA 71129-4814 (864) 844-2812
2 Mark Roy 5642 N. Heatherstone Drive Shreveport LA 71129-4814 (864) 844-2812
1 Mark Roy 5642 N. Heatherstone Drive Shreveport LA 71129-4814 (864) 844-2812
1 Mark Roy 5642 N. Heatherstone Drive Shreveport LA 71129-4814 (864) 844-2812
1 Mark Roy 5642 N. Heatherstone Drive Shreveport LA 71129-4814 (864) 844-2812
2 Mark Roy 5642 N. Heatherstone Drive Shreveport LA 71129-4814 (864) 844-2812
1 Mark Roy 5642 N. Heatherstone Drive Shreveport LA 71129-4814 (864) 844-2812


Would a pivot table work for you here?

Beege


All times are GMT +1. The time now is 04:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com