Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,650
- Office Version
- 365
- 2016
- Platform
- Windows
I have a range of cells to which they have been assigned a name of "modlist". It contains approx. 1000 values.
The snippet of code below is supposed to transpose those values of "modlist" to the cells of column AB starting at a specific cell determined by the value of drow calculated earlier. (drow = 4). In this example, the values of "modlist" will be transposed starting at AB4.
The code does transpose to AB4, however, instead of each individual value in "modlist", it transposes 1000+ instances of the first value of thousands. So if the first value in "modlist" was Giraffe, 1000+ instances of Giraffe is applied to the column at AB4.
The snippet of code below is supposed to transpose those values of "modlist" to the cells of column AB starting at a specific cell determined by the value of drow calculated earlier. (drow = 4). In this example, the values of "modlist" will be transposed starting at AB4.
The code does transpose to AB4, however, instead of each individual value in "modlist", it transposes 1000+ instances of the first value of thousands. So if the first value in "modlist" was Giraffe, 1000+ instances of Giraffe is applied to the column at AB4.
VBA Code:
...
drow = (.Cells(.Rows.count, "AB").End(xlUp).Row) + 1
Set sourceRng = ThisWorkbook.names("Modlist").RefersToRange
Set targetRng = .Cells(drow, 28)
transposedData = Application.WorksheetFunction.Transpose(sourceRng.Value)
targetRng.Resize(UBound(transposedData), 1).Value = transposedData
...