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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:28:40+00:00 2026-05-11T07:28:40+00:00

I have have the following data in excel: a, b, c d e f,

  • 0

I have have the following data in excel:

a, b, c d e f, g h i 

with each row, representing a row and in one cell.

I would like to convert it to:

a b c d e f g h i 

I am using the following macro, but I can’t get the autosize to do an insert, instead of overriding the cell values. Any help is appreciated.

    Sub SplitCells()       Dim i As Long        With Application          .Calculation = xlCalculationManual          .ScreenUpdating = False         For i = 1 To Selection.Rows.Count          Dim splitValues As Variant           splitValues = split(Selection.Rows(i).Value, ',')          Selection.Rows(i).Resize(UBound(splitValues) - LBound(splitValues) + 1).Value = Application.Transpose(splitValues)      Next i            .Calculation = xlCalculationAutomatic          .ScreenUpdating = True      End With  End Sub 
  • 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. 2026-05-11T07:28:41+00:00Added an answer on May 11, 2026 at 7:28 am

    This macro will take your data from column A and ‘extract’ it to column B. The results are shown below, feel free to cower at my graphical presentation skills 🙂

        <- A ->   <- B -> 1   a, b, c   a 2   d         b 3   e         c 4   f, g      d 5   h         e 6   i         f 7             g 8             h 9             i 

    I’ve left it as non-destructive for testing purposes, and since it’s relatively easy to create a new column, populate it and delete the old column in VBA. An exercise for the reader…

    Here is the macro:

    Option Explicit Sub Macro1()     Dim fromCol As String     Dim toCol As String     Dim fromRow As String     Dim toRow As String     Dim inVal As String     Dim outVal As String     Dim commaPos As Integer      ' Copy from column A to column B.'     fromCol = 'A'     toCol = 'B'     fromRow = '1'     toRow = '1'      ' Go until no more entries in column A.'     inVal = Range(fromCol + fromRow).Value     While inVal <> ''          ' Go until all sub-entries used up.'         While inVal <> ''             Range(fromCol + fromRow).Select              ' Extract each subentry.'             commaPos = InStr(1, inVal, ',')             While commaPos <> 0                  ' and write to output column.'                 outVal = Left(inVal, commaPos - 1)                 Range(toCol + toRow).Select                 Range(toCol + toRow).Value = outVal                 toRow = Mid(Str(Val(toRow) + 1), 2)                  ' Remove that sub-entry.'                 inVal = Mid(inVal, commaPos + 1)                 While Left(inVal, 1) = ' '                     inVal = Mid(inVal, 2)                 Wend                 commaPos = InStr(1, inVal, ',')             Wend              ' Get last sub-entry (or full entry if no commas).'             Range(toCol + toRow).Select             Range(toCol + toRow).Value = inVal             toRow = Mid(Str(Val(toRow) + 1), 2)             inVal = ''         Wend          ' Advance to next source row.'         fromRow = Mid(Str(Val(fromRow) + 1), 2)         Range(fromCol + fromRow).Select         inVal = Range(fromCol + fromRow).Value     Wend End Sub 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following problem in my Data Structures and Problem Solving using Java
I have the following sql query for transforming data but is it possible to
Hi I have following data in the table: ID-----startDate----endDate 5549 2008-05-01 4712-12-31 5567 2008-04-17
I have the following data structure (a list of lists) [ ['4', '21', '1',
I have a sql table which have the following data, Id City Country ---
I have the following table and data in SQL Server 2005: create table LogEntries
I have the following function that is pulling data from a database. The ajax
I have a file in the following format: Data Data Data [Start] Data I
I have the following serialization method: Private Function SerializeData(ByVal data As cData) As String
I have the following Query and i need the query to fetch data from

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.