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 6910179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:46:52+00:00 2026-05-27T08:46:52+00:00

This question ended up being more interesting than I thought it would be, and

  • 0

This question ended up being more interesting than I thought it would be, and I have solved the direct issue for my purposes.

But now I have a question for which the answer should be simple, but I can’t find it.

After TextToColumns has done its thing, how can I figure out how many columns were created?
The number of columns in my results are variable, and it’s not guaranteed that there’s whitespace after the end of the split.

It would be great if the TextToColumns function returned the number of columns it created, but that doesn’t seem to work.

I don’t want to just count the commas before splitting; there are situations of commas inside quotes, for example, which TextToColumns seems to handle just fine. If I was going to have to count character-by-character, then I might as well write my own split function.

(The reason I need this is so I can offer the option to transpose the results)

Thanks.

  • 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-05-27T08:46:53+00:00Added an answer on May 27, 2026 at 8:46 am

    You can check with UsedRange. Please see below example:

    Sub check()
    Dim before As Integer
    Dim after As Integer
    before = Sheet1.UsedRange.Columns.Count
    MsgBox before
    Range("A1").TextToColumns DataType:=xlDelimited, _
        Comma:=False, Space:=True
    after = Sheet1.UsedRange.Columns.Count
    MsgBox after
    MsgBox after - before
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a difficult and open-ended question I know, but I thought I'd throw
Variations of this question have been asked before, but it seems like the issue
I hope this question isn't too open ended, but a nudge in the right
This is a relatively open ended question so I wouldn't just mind being pointed
It's probably more a generic question about database, than a django one but let's
I assume that this question may be slightly too open ended, but I am
This is going to be a pretty open ended question; but at this point
I posted this question here before but there were no responses. I may have
This question is a bit open ended as I'm not sure it's possible or
This question would probably apply equally as well to other languages with C-like multi-line

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.