VBA Code to paste rows values as transpose to columns

Monty9

New Member
Joined
Feb 26, 2016
Messages
26
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have this excel where I have multiple questions and 4 options in a column as below;
Question
Option 1
Option 2
Option 3
Option 4

I am looking for the code which can convert these Options from rows to transpose to columns against each question. Please note there are multiple questions and each question have always 4 options with a blank row at the end of each question/option set. Example is as below;

What is SAP S/4HANA EAM, and what is its purpose?​
A) It is a supply chain management tool.​
B) It is a project management tool.​
C) It is an enterprise asset management tool.​
D) It is a customer relationship management tool.​
Answer: C​
What is the difference between SAP EAM and SAP S/4HANA EAM?​
A) SAP EAM is an outdated version of SAP S/4HANA EAM.​
B) SAP S/4HANA EAM is a cloud-based application.​
C) SAP EAM is a standalone application, while SAP S/4HANA EAM is integrated with other modules.​
D) There is no difference between the two.​
Answer: C​
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
A formula can do that:

=IF(ISNUMBER(SEARCH("~?",A1)),INDEX(A1:A5,SEQUENCE(1,4,2,1)),"")
 
Upvote 0
Assuming that your data starts in A2 with a header in A1 and that you want the transposed data
to start on row 2 in any sheet:

=TRANSPOSE(OFFSET(ToTransposeData!$A$1,(((ROW()-1)*7)-7)+1,0,5,1))

where 'ToTransposeData' is the name of the worksheet containing the questions.

Copy this formula down for as many questions as you have.

If you want to include the answer then change the 5 to a 6.
 
Upvote 0

Forum statistics

Threads
1,216,462
Messages
6,130,781
Members
449,591
Latest member
sharmavishnu413

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