filmov
tv
Transpose Rows to Columns (From One Sheet to Another) | Excel VBA Macro
Показать описание
Excel VBA Macro: Transpose Rows to Columns (From One Sheet to Another). In this video, we use a nested For Loop to transpose multiple columns on one sheet into rows on another sheet. We create a macro that determines the size of a given range, and then transposed that range to another worksheet. We also go over how to clear the contents from a worksheet with VBA.
Data used in this video:
Code:
Sub transpose_to_another_sheet()
Dim og As Worksheet
Dim ns As Worksheet
Dim count_col As Integer
Dim count_row As Integer
Set og = ThisWorkbook.Sheets(1)
Set ns = ThisWorkbook.Sheets(2)
ns.Cells.ClearContents
og.Activate
count_col = WorksheetFunction.CountA(Range("A1", Range("A1").End(xlToRight)))
count_row = WorksheetFunction.CountA(Range("A1", Range("A1").End(xlDown)))
For i = 1 To count_col
For j = 1 To count_row
ns.Cells(i, j) = og.Cells(j, i).Text
Next j
Next i
ns.Activate
End Sub
#ExcelVBA #ExcelMacro
Data used in this video:
Code:
Sub transpose_to_another_sheet()
Dim og As Worksheet
Dim ns As Worksheet
Dim count_col As Integer
Dim count_row As Integer
Set og = ThisWorkbook.Sheets(1)
Set ns = ThisWorkbook.Sheets(2)
ns.Cells.ClearContents
og.Activate
count_col = WorksheetFunction.CountA(Range("A1", Range("A1").End(xlToRight)))
count_row = WorksheetFunction.CountA(Range("A1", Range("A1").End(xlDown)))
For i = 1 To count_col
For j = 1 To count_row
ns.Cells(i, j) = og.Cells(j, i).Text
Next j
Next i
ns.Activate
End Sub
#ExcelVBA #ExcelMacro
How To Convert Data in Columns into Rows in Excel Document
3 Ways to Transpose Excel Data (Rotate data from Vertical to Horizontal or Vice Versa)
Transpose Rows into Columns in Excel
Convert a column to row in Excel
How to Transpose Rows into Columns in Excel
Convert Columns to Rows in Excel (NO Transpose, NO Formulas - SIMPLY UNPIVOT in Power Query)
Excel Trick#56 : How To Transpose Multiple Columns And Rows Into Single Column || dptutorials
SQL Convert Rows to Columns and Columns to Rows without using Pivot Functions
Maths 2 | TA Session - Week 1b
How To Convert Rows To Columns In Excel? | Transpose In Excel | Excel For Freshers | Simplilearn
Excel Transpose (rotate) data from rows to columns or vice versa
How to transpose multiple rows and columns in Excel in one shot
Convert Row Data into Column in Excel
SQL Query - Convert data from Rows to Columns | Pivot
Transpose Rows into Columns in informatica
Transpose One Column Into Multiple Columns with Excel Macro
Transpose using power query | How to convert horizontal data vertically | pasting data vertically
Easily Transpose Data from Rows to Columns in Excel
How to Transpose Rows and Columns in Excel 2016
Excel VBA Macro: Transpose Rows to Columns (From One Sheet to Another)
Convert comma separated list of data into columns in EXCEL!!!!!!
Pivot or Transpose Multiple Columns using Python
Transpose Rows to Columns in Excel using Loop VBA Code
How to Transpose (Flip Rows and Columns) in Google Sheets
Комментарии