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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:51:12+00:00 2026-05-15T15:51:12+00:00

I have an excell fill with these data in it : Name1 1 2

  • 0

I have an excell fill with these data in it :

Name1
1
2
3
Name2
1
2
3
4
Name3
1
2
......

I want to have Names in a cell in front of each row below it like this :

1          Name1
2          Name1
3          Name1
1          Name2
2          Name2
3          Name2
4          Name2
1          Name3
2          Name3
....

is there any way to do this?

  • 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-15T15:51:13+00:00Added an answer on May 15, 2026 at 3:51 pm

    Here is one way you could approach this problem; it makes some assumptions that you may have to address if they turn out to be false.

    Dim n As String
    Dim v As String
    
    Dim row As Long
    Dim col As Integer
    
    Dim c As Range
    
    Dim destRow As Long
    Dim destCol As Integer
    
    'Assume your data is in column A, starting in row 1
    row = 1
    col = 1
    
    'and that you want to drop it into columns C and D starting in row 1
    destRow = 1
    destCol = 3
    
    Do
        Set c = ActiveSheet.Cells(row, col)
        If Left(c.Value, 4) = "Name" Then
            n = c.Value
        ElseIf n <> "" Then
            Cells(destRow, destCol).Value = c.Value
            Cells(destRow, destCol + 1).Value = n
            destRow = destRow + 1
        End If
        row = row + 1
    Loop Until ActiveSheet.Cells(row, col).Value = ""
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay all, I have a form that I want users to fill out. When
I have an Excel Spreadsheet like this id | data for id | more
I have an Excel application in which I want to present the user with
I am importing massive amounts of data from Excel that have various table layouts.
I have a C#/.Net job that imports data from Excel and then processes it.
In an Excel sheet, I have roughly 30 rows x 100 columns of data.
I have Excel add-in which I add so many class modules that it is
We have an Excel 2002/XP based application that interacts with SQL 2000/5 to process
I have an excel spreadsheet in a format similar to the following... | NAME
I have an excel file which has more than 65536 rows. However, I can

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.