Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8776145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:58:52+00:00 2026-06-13T18:58:52+00:00

I am Trying to Transpose a range of cells in Excel through VBA macro

  • 0

I am Trying to Transpose a range of cells in Excel through VBA macro but I am getting some errors, mostly Error 91.

I am pretty new to VBA and don’t have much idea about functions either.

Range(InRng).Select
Set Range1 = Selection
Dim DestRange As Range
Set DestRange = Application.WorksheetFunction.Transpose(Range1)

After going through a couple of forums, this is what I have come up with. One thing to note is that I don’t have to copy them into any other cells.

What I am trying to achieve is to create a co-variance method and in the option window the user will have the option to select the range and then choose either by columns or rows, this will then affect the resulting covariance matrix.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T18:58:53+00:00Added an answer on June 13, 2026 at 6:58 pm

    This gets you X and X’ as variant arrays you can pass to another function.

    Dim X() As Variant
    Dim XT() As Variant
    X = ActiveSheet.Range("InRng").Value2
    XT = Application.Transpose(X)
    

    To have the transposed values as a range, you have to pass it via a worksheet as in this answer. Without seeing how your covariance function works it’s hard to see what you need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to code this expression in python but I'm having some difficulty. This
I am trying move rows of values into a column in Excel. The transpose
I am trying to get a simple VBA code as part of a Macro
I'm trying to return a value from (transport) to the calling function, but can't
Trying to copy the msdn refernce here doesn't work and gives an error I
I'm trying to do an Matrix animation where I both scale and transpose a
I am trying to build an elegant transpose function using functions mapn and zip
I am trying to do some manipulations on images using OpenCV. I am receiving
I'm trying to debug an app running inside the windows phone 7 emulator, but
I am trying to optimize (memorywise the multiplication of X and its transpose X'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.