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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:47:56+00:00 2026-05-11T03:47:56+00:00

I have a text column with repeated values, for example: | A | —|———|

  • 0

I have a text column with repeated values, for example:

   |    A    |  ---|---------|  1 | emails  |  2 |  foo    |  3 |  foo    |  4 |  bar    |  5 |  bar    |  6 |  stuff  |  7 |  stuff  |  8 |  stuff  | 

What I would like to do is to have another column with numbers, so that each number matches the value in the first column, for example:

   |    A    |    B    |  ---|---------|---------|  1 | emails  | number  |  2 |  foo    |    1    |  3 |  foo    |    1    |  4 |  bar    |    2    |  5 |  bar    |    2    |  6 |  stuff  |    3    |  7 |  stuff  |    3    |  8 |  stuff  |    3    | 
  • 1 1 Answer
  • 3 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-11T03:47:56+00:00Added an answer on May 11, 2026 at 3:47 am

    Depending on what you mean by value –

    If you mean ‘repeating group’ then a macro like this may work –

     Sub Check()     Dim start As Integer     start = 1     For Row = 2 To 12         Cells.Item(Row, 2) = start         If Cells.Item(Row, 1) <> Cells.Item(Row + 1, 1) Then             start = start + 1         End If     Next End Sub 

    If you mean 'take the number at the end of each value in column A' then this may work -

     Sub Check()     Dim i As Integer     Dim value As String     Dim number As String     Dim c As String     For Row = 2 To 12         number = ''         value = Cells.Item(Row, 1)         For i = 1 To Len(value)             c = Mid(value, i, 1)             If IsNumeric(c) Then                 number = number & c             End If         Next         Cells.Item(Row, 2) = number     Next End Sub 

    Edit - According to the OP's comment, I'm guessing they mean 'repeating group' but I'll leave both code samples here.

    Edit - Copy and paste the code into the excel Visual Basic Editor and click play. Replace the constants 2 and 12 with the values of your start and end rows.

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

Sidebar

Related Questions

I have a table with a TEXT column where the contents is just strings
I have saved input from a textarea element to a TEXT column in MySQL.
I have problem when I try insert some data to Informix TEXT column via
I am using SQL Server 2005. I have a table with a text column
I have a textbox with the Text property bound to a dataset column with
I have a sproc that returns a single line and column with a text,
In a project we have text files looking like this: mv A, R3 mv
Suppose I have a text file with data separated by whitespace into columns. I
I'm looking to have text display vertically, first letter at the bottom, last letter
I have a snippet to create a 'Like' button for our news site: <iframe

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.