Pulling specific columns by transpose two headers

deniztopcu

New Member
Joined
May 9, 2022
Messages
33
Office Version
  1. 2021
  2. 2019
Platform
  1. Windows
I want to pull the last 5 quarter data of "Symbol and itemcode" from the table.
Symbol and item code" must be transpose.

Pulling specific columns by transposing two headers

I want to reach an image like the first picture so that I can compare.

2.png


1.png

3.png
 
Rica ederim. Yardımcı olduğunuza sevindim.
Gönderiyi, koruyucu okuyuculara yardımcı olmanıza yardımcı olan çözüm olarak işaretlerseniz bu harika olur.

(Bir şey değil :) )
Thanks
(Çeviri yapmak, sorundan daha çok yoruyor.:) Tekrar emeklerinizden dolayı teşekkür ederim.)
 
Upvote 0

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
But I will try to handle this with a macro embedded in a button.
Although the following is not something that I will advise since it will run at every change in the data range cells which will dramatically affect the performance and also reset the "Undo" action, it is possible to kind of automate the Pivot Table refresh by detecting cell value changes in the cells in the Worksheet_Change() event procedure of Sheet2 (where the source data table resides).

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Application.Intersect(Target, ActiveSheet.ListObjects("Combined_tblFinancials").DataBodyRange) Is Nothing Then
        Sheet1.PivotTables(1).PivotCache.Refresh
    End If
End Sub

Even I don't suggest doing what I "shown" above, you can still use the one-liner from the same code in a button click event procedure as you mentioned for an on-demand refresh:
VBA Code:
Sheet1.PivotTables(1).PivotCache.Refresh


Note: You might want to uncheck the "Autofit column widths on update" option in any case.
1672697994324.png


It is a great loss for me that I have not used a pivot table before.
It is never too late!
(In fact, I also suggest taking a look at Power Query as well - unless you are already working with it. It is a whole different world in Excel if you are struggling with data cleansing and transforming data coming from other sources, like accounting application exports, etc.)

(Çeviri yapmak, sorundan daha çok yoruyor.:) Tekrar emeklerinizden dolayı teşekkür ederim.)
You can also use the Questions in Other Languages section in your language and someone who speaks your language will surely help. Yet I suggest sticking here as much as you could to get faster help.

Thanks for marking the solution post as it will help future readers.
 
Upvote 0
I used to use power query manually myself.
With the support I got from the forum, my queries turned from turtle to rabbit. like a magic wand.

But the most important reason why I search for new methods is to find a "fast and stable" working method...


Thank you very much for the macro codes.thanks @smozgur

1672700122311.png
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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