Change table format

Eva146

New Member
Joined
May 8, 2024
Messages
2
Office Version
  1. 2013
Platform
  1. Windows
Good evening,

I have this table with expression and gene names and number of groups(basically around 1100 genes per group).The other groups are further down

1715160408070.png

I need to turn it into this:
1715160511882.png

Same expression numbers just different format.Can you help me?
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
What is supposed to go in the 0-12 columns? Does a PivotTable not get the job done?
 
Upvote 0
In the columns 0-12 I should have the avg expression values.I need this form of table for various reasons.I have constructed a vba code but it doenst work like I wanted to so I would like your opinion on whats wrong(sorry its my first time with vba).Basicallly, the code is that if I have the same value in B column for 15 consecutive times then I want the values from A column from the same range transposed to the new table and the range from B column to be deleted(that is why the new data will always be trasported on the top of the table and checked there).But if that is not the case and I have less than 15 values then I want that part of the table to be transefered to the bottom of a new table and the original part to be deleted

I filtered and origianal table and I am sending the new one

I hope I was clear.I can answer questions if I am confusing on some parts

Sub TransposeRange()
Dim c As Range
For Each c In Sheets("Table").Range("F30:F911").Rows
If B2 = B16 Then
'specify range to transpose
Dim MyRange()
MyRange = Range("A2:A16")
'find dimensions of range
XUpper = UBound(MyRange, 1)
XLower = LBound(MyRange, 1)
YUpper = UBound(MyRange, 2)
YLower = LBound(MyRange, 2)
'transpose range
Range(c).Resize(YUpper - YLower + 1, XUpper - XLower + 1).Value = _
WorksheetFunction.Transpose(MyRange)
'delete range
Dim tbl As ListObject
Set tbl = ActiveSheet.ListObjects("Table1")
For i = 1 To 15
tbl.ListRows(1).Delete
Next
Else
Dim Value As String
Value = Table.Range("B2")
Dim x As Integer
x = WorksheetFunction.CountIf(Table.Range("B2:B16"), Value)
lngLastRow_V = Cells(Rows.Count, "V").End(xlUp).Row
lngLastRow_X = Cells(Rows.Count, "X").End(xlUp).Row
Range("A2:Cx").Cut Range("lngLastRow_V:lngLastRow_X")
Range("A2:Cx").Delete
End If
Next
End Sub
1715688027951.png
 
Upvote 0

Forum statistics

Threads
1,216,117
Messages
6,128,937
Members
449,480
Latest member
yesitisasport

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