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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:12:56+00:00 2026-05-30T23:12:56+00:00

I am trying to migrate a dataset from an old spreadsheet based system to

  • 0

I am trying to migrate a dataset from an old spreadsheet based system to a database. And I have one outstanding single issue to solve.

I have a sheet within a spreadsheet that is acting like a many-to-many table:

  • It has a column names
  • It also has a leading column as a rowID/Name making rows unique
  • On the crossing of rows and columns I have either an empty cell or an
    ‘X’ (X worked in old system as a relation between two different data
    sets)

    Rows_name|Column_name1 |Column_name2 |Column_nameX

    Row_name1| | X | X

    Row_name2| X | |

    Row_name3| X | X | X

For each found ‘X’ I require to copy Row_name and Column_name to separate sheet ready for export.

I.E. For Row_name3 it would be three new rows in a new sheet as Row_name3 has three ‘X’s

Rows_name|Column_name

Row_name3|Column_name1

Row_name3|Column_name2

Row_name3|Column_name3

In effect I am solving a many to many relation by having a third table.

Therefore I am looking for a help with the algorithm to find all related column/row names for each ‘X’.

For any suggestions how to tackle this I would be very grateful.

  • 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-30T23:12:57+00:00Added an answer on May 30, 2026 at 11:12 pm

    Is this what you are trying?

    Option Explicit
    
    Sub Sample()
        Dim wsInput As Worksheet, wsOutput As Worksheet
        Dim LRI As Long, LRO As Long, i As Long, j As Long
    
        '~~> Input Sheet
        Set wsInput = Sheets("Sheet1")
        LRI = wsInput.Range("A" & wsInput.Rows.Count).End(xlUp).Row
    
        '~~> Output Sheet
        Set wsOutput = Sheets("Sheet2")
        LRO = 2
    
        For i = 2 To LRI
            With wsInput
                For j = 1 To 3
                    If UCase(Trim(.Range("A" & i).Offset(, j).Value)) = "X" Then
                        .Range("A" & i).Copy wsOutput.Range("A" & LRO)
                        .Range("A1").Offset(, j).Copy wsOutput.Range("B" & LRO)
                        LRO = LRO + 1
                    End If
                Next
            End With
        Next i
    End Sub
    

    SNAPSHOT

    enter image description here

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

Sidebar

Related Questions

i'm trying to migrate some data from two tables in an OLD database, to
I am trying to migrate microsoft office settings from one system to other system
I am trying to migrate data from one table to other. The issue is
I'm trying to migrate a site from a joomla system to a drupal. The
I'm still trying to migrate from CakePHP 1.3 to 2.0 I have a Controller
I'm trying to migrate my application from Rails 3.0.7 to Rails 3.1.3. I have
I am trying to migrate to svn from a not-so-famous version control system (lets
Im trying to migrate an old project from Delphi 5 to Delphi XE. When
I am trying to migrate the heroku shared database from app1 to clearDB in
I am trying to migrate from windows 7 to mac osx . I have

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.