Coding⏱️ 3 min read📅 2026-06-11

How to Fix error 438 Error – Excel VBA: Application.Tranpose on an array gives Run-time error 438

Error 438 occurs when attempting to transpose an array in VBA, likely due to the array being a range object rather than a numerical array.

Quick Answer: Use the Range.Value property instead of Transpose to fix the error.

The Excel VBA Application.Transpose function on an array can give a Run-time error 438. This error occurs when the code tries to transpose an array that does not support this operation.

This error affects users who are using Excel VBA to manipulate data in their workbooks. It can be frustrating for those who have to deal with it regularly, and in this guide, we will explore the root causes of this issue and provide a solution.

🔍 Why This Happens

  • The first main reason why this error happens is that the array being transposed does not support the Transpose function. This can occur when the array contains non-numeric data or when the array has been created using a method that does not preserve its original structure.
  • An alternative reason for this error could be that the code is trying to transpose an array that is too large to fit into memory. In this case, the Transpose function may fail because it cannot handle the size of the array.

🛠️ Step-by-Step Verified Fixes

Using the .Value property instead of Transpose

  1. Step 1: To fix this issue, you can try using the .Value property instead of the Transpose function. This will allow you to access the values in the array without trying to transpose it.
  2. Step 2: Replace the line `OutputTickers = Application.Tranpose(TopNTickers)` with `OutputTickers = TopNTickers.Value`. This will assign the values in the TopNTickers array to the OutputTickers range.
  3. Step 3: This method is a good alternative when you need to work with arrays that do not support the Transpose function.

Checking for non-numeric data or large arrays

  1. Step 1: Another way to fix this issue is to check if the array contains non-numeric data or if it is too large to fit into memory. You can use the IsNumeric function to check if the values in the array are numeric, and you can use the LBound and UBound functions to determine the size of the array.
  2. Step 2: You can add error checking code before trying to transpose the array to ensure that it meets these conditions.

🎯 Final Words

By following these steps, you should be able to fix the Run-time error 438 caused by the Application.Transpose function on an array. Remember to always check for non-numeric data and large arrays when working with arrays in Excel VBA.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions