Proiblem Transposing Named Range Data To A Column

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,650
Office Version
  1. 365
  2. 2016
Platform
  1. 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.

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
...
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hello Fluff. A dynamic range of cells from worksheet ws_modlist.range("M2:M1247") was given the name "modlist" earlier in my project. A look at that name in name manager reveals the proper range and the values of all cells. Only the 1st value in that named range is being transposed 1247 times.
 
Upvote 0
Then why are you trying to transpose that into another vertical range? Or should it be transposed to a single row?
 
Upvote 0
I think only for the purposes of learning about how I can use names. I could copy and paste that range as an option, but this is how I'm learning that this method may not work.

I'm using that existing range of cells and adding it to the end of other data to create a new list. Taking the range M2:M1247 to data at the end of column AB.
 
Upvote 0
The problem is not the named range, it's that you are trying to transpose a single column into another single column.
If you transposed it into a single row, then it would work.
 
Upvote 0
Ah, i see. Transpose takes vertical data and makes it horizontal or vice versa?
 
Upvote 0

Forum statistics

Threads
1,225,626
Messages
6,186,094
Members
453,337
Latest member
fiaz ahmad

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