last 5 yellow highlights transpose

makinmomb

Active Member
Joined
Dec 23, 2013
Messages
401
I have these kind of data on a1

[TABLE="width: 76"]
<colgroup><col></colgroup><tbody>[TR]
[TD] 250,000[/TD]
[/TR]
[TR]
[TD] 48,000[/TD]
[/TR]
[TR]
[TD] 50,000[/TD]
[/TR]
[TR]
[TD] 35,000[/TD]
[/TR]
[TR]
[TD] 40,000[/TD]
[/TR]
[TR]
[TD] 60,000[/TD]
[/TR]
[TR]
[TD] 35,000[/TD]
[/TR]
[TR]
[TD] 230,000[/TD]
[/TR]
[TR]
[TD] 35,000[/TD]
[/TR]
[TR]
[TD] 16,000[/TD]
[/TR]
[TR]
[TD] 15,000[/TD]
[/TR]
[TR]
[TD] 814,000[/TD]
[/TR]
[TR]
[TD] 45,000[/TD]
[/TR]
[TR]
[TD] 50,000[/TD]
[/TR]
[TR]
[TD] 90,000[/TD]
[/TR]
[TR]
[TD] - [/TD]
[/TR]
[TR]
[TD] 200,000[/TD]
[/TR]
[TR]
[TD] 140,000[/TD]
[/TR]
[TR]
[TD] 210,000[/TD]
[/TR]
[TR]
[TD] 65,000[/TD]
[/TR]
[TR]
[TD] 800,000[/TD]
[/TR]
[TR]
[TD] 144,000[/TD]
[/TR]
[TR]
[TD] 40,000[/TD]
[/TR]
[TR]
[TD] 5,000[/TD]
[/TR]
[TR]
[TD] - [/TD]
[/TR]
[TR]
[TD] 65,000[/TD]
[/TR]
[TR]
[TD] 25,000[/TD]
[/TR]
[TR]
[TD] 10,000[/TD]
[/TR]
[TR]
[TD] 289,000[/TD]
[/TR]
[TR]
[TD] 50,000[/TD]
[/TR]
[TR]
[TD] 43,000[/TD]
[/TR]
[TR]
[TD] 41,000[/TD]
[/TR]
[TR]
[TD] 73,000[/TD]
[/TR]
[TR]
[TD] - [/TD]
[/TR]
[TR]
[TD] 200,000[/TD]
[/TR]
[TR]
[TD] 10,000[/TD]
[/TR]
[TR]
[TD] 10,000[/TD]
[/TR]
[TR]
[TD] 427,000[/TD]
[/TR]
[TR]
[TD] 43,700[/TD]
[/TR]
[TR]
[TD] 106,200[/TD]
[/TR]
[TR]
[TD] 5,500[/TD]
[/TR]
[TR]
[TD] 2,000[/TD]
[/TR]
[TR]
[TD] 2,000[/TD]
[/TR]
[TR]
[TD]0[/TD]
[/TR]
[TR]
[TD] 556,000[/TD]
[/TR]
[TR]
[TD] 715,400[/TD]
[/TR]
[TR]
[TD] 45,400[/TD]
[/TR]
[TR]
[TD] 444,000[/TD]
[/TR]
[TR]
[TD] 27,000[/TD]
[/TR]
[TR]
[TD] 41,000[/TD]
[/TR]
[TR]
[TD] 73,000[/TD]
[/TR]
[TR]
[TD] - [/TD]
[/TR]
[TR]
[TD] 240,000[/TD]
[/TR]
[TR]
[TD] 5,000[/TD]
[/TR]
[TR]
[TD] 10,000[/TD]
[/TR]
[TR]
[TD] 15,000[/TD]
[/TR]
[TR]
[TD] 70,000[/TD]
[/TR]
[TR]
[TD] 48,000[/TD]
[/TR]
[TR]
[TD] 1,018,400[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
1,018,400 , 715,400 , 427,000 , 289,000 and 800,000

Are in yellow highlights

I need a macro that should put to do the following

put on c1 1018400
put on d1 715400
put on e1 42700
put on f1 289000
put on g1 800000
 
Upvote 0
Try:
Code:
Sub TranposeRange()
    Application.ScreenUpdating = False
    Dim LastRow As Long
    LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
    Range("A1:A" & LastRow).AutoFilter Field:=1, Criteria1:=RGB(255, 255, 0), Operator:=xlFilterCellColor
    Range("A2:A" & LastRow).SpecialCells(xlCellTypeVisible).Copy
    Range("C1").PasteSpecial Transpose:=True
    Range("A1").AutoFilter
    Application.ScreenUpdating = True
End Sub

The macro assumes you have headers in row 1 and your data starts in row 2.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,287
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top