![]() Use it on sample data before you use it on real data so that you fully understand how it will behave and what it will do.ĭownload the sample file attached to this tutorial to test out the macro. This macro will give you the result displayed in the Example section above here. 1 is for column A, 2 for column B, etc.ĭest_start_row = 1 the row in which you want the transposed data to start filling-in. If the data is in column A, this should be 1, column B, this should be 2, etc.ĭest_start_col = 3 the column where you want the data to be transposed. ![]() If the data starts in row 1, this should be 1, row 2, this should be 2.įirst_col = 1 this is the column that contains the data to transpose. These are the results of transposing: Rows and. Change the 5 to whatever interval you want.įirst_row = 1 this is the first row of the data that you want to move from a column to a row, transpose. Choose Table > Transpose Rows and Columns (from the Table menu at the top of your screen). Interval = 5 this is the number of values that will be placed on each row when you transpose the column. If (cur_row - (first_row - 1)) Mod interval = 0 Then Last_row = Cells(Rows.Count, first_col).End(xlUp).RowĬells(dest_cur_row, dest_cur_col).Value = Cells(cur_row, first_col).Value 'first column where you want the data to go Step 1: Copy the rows you want to convert to columns or columns to be changed to rows. ![]() ![]() 'first column of the data that you want to transpose Follow these steps to transpose the table and link it with the original data. Transpose (rotate) data from rows to columns or vice versa Select the range of data you want to rearrange, including any row or column labels, and press Ctrl+C. 'first row of the data that you want to transpose
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |