Application.Transpose

AlexanderBB

Well-known Member
Joined
Jul 1, 2009
Messages
2,148
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
This was recommended as a way to build an array from Values in a Worksheet row, In this example Col Y to AF in row chRow
VBA Code:
Dim Ary as variant
 Ary = Application.Transpose(Application.Transpose _
             (Worksheets(.Name).Range("Y" & chRow & ":AF" & chRow).Value))
If works great but I've struck a problem. If only Col Y contains a value Ary is a string.
My code fails as it expects an array.
What is a good way to resolve this ? I can test isArray(ary) and perhaps force the string into an array but it doesn't seem right.
 
You entered the date as a number then changed Cell format to dd mmm yyyy ?
I entered it in a recognized date syntax for my region (i.e. I entered it as 14/2/25) with the cell in it's default General number format, then changed the cells custom number format
Something about the cells format needing to be set when the cell was empty.
The only cell format to be avoided (unless you have a specific need) before entering your data is Text
 
Last edited:
Upvote 0

Forum statistics

Threads
1,226,812
Messages
6,193,116
Members
453,777
Latest member
Miceal Powell

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