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

  • Home
  • SEARCH
  • 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 6926893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:58:38+00:00 2026-05-27T10:58:38+00:00

Currently I have spreadsheets coming in that are formatted incorrectly. Our client sent out

  • 0

Currently I have spreadsheets coming in that are formatted incorrectly. Our client sent out to his suppliers an old spreadsheet where columns are laid out differently than what they are currently setup as. Normally we would tell them to correct it, but some of these spreadsheets have over 220k rows and 33 columns. They’re updating it for the future, but asking them to have their clients redo their tables is a no-go. I’ve written a script that will copy a column, and place it into the corresponding static column in another workbook. This works okay but I feel there is more that could be done.

Name of open workbook copying from varies.

Name of workbook copied to: C:\User\(Name)\UCOR\Catalogs\PSX-Toolset v1.503-EN.xls

What I would like is help writing a macro that will do the following from open workbook:

1.) Select an entire column minus Row 1 to the first blank row. – This goes from B to AH

2.) Paste that column into PSX-Toolset workbook, worksheet name “Item Data” – Static Assigned Columns

3.) Perform a Save As on PSX-Toolset as (Catalog-PSX-<Workbook Copied From>.xls)

Lastly, I’d like to know if it’s possible to do the above, but mapping heading cells. Unfortunately the cell names are not identical.

  • 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-27T10:58:38+00:00Added an answer on May 27, 2026 at 10:58 am

    Untested:

    Sub MapAndCopyColumns()
    
    Dim i As Integer, rng As Range
    Dim shtSrc As Worksheet, wbDest As Workbook
    Dim shtDest As Worksheet
    Dim iNew
    
        Set shtSrc = ActiveSheet
        Set wbDest = Workbooks.Open("C:\User\(Name)\UCOR\Catalogs\PSX-Toolset v1.503-EN.xls")
        Set shtDest = wbDest.Sheets("Item Data")
    
        For i = 2 To 34
            Set rng = shtSrc.Cells(2, i)
            If rng.Value <> "" Then
                If rng.Offset(1, 0).Value <> "" Then
                    Set rng = Range(rng, rng.End(xlDown))
                End If
                'map old position >> new position
                '  mapping table has 2 columns of numbers: "old" and "new"
                iNew = Application.VLookup(i, _
                    ThisWorkbook.Sheets("Mapping").Range("A2:B40"), 2, False)
                If Not IsError(iNew) Then
                    'copy if the column has an entry in the mapping table
                    rng.Copy shtDest.Cells(2, iNew)
                End If
            End If
        Next i
    
        wbDest.SaveAs "C:\wheretosaveto\Catalog-PSX-" & shtSrc.Parent.Name
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a spreadsheet that is currently formatted improperly for a mysql import. The
Currently, I have an Excel spreadsheet with some data and a command button that
I currently have an MS Access application that connects to a PostgreSQL database via
I currently have a DetailsView in ASP.NET that gets data from the database based
I have an excel spreadsheet that has 2 columns. Something like this |ColA |
currently I have a web which loads excel spreadsheet data into SQL database. When
I have a user that is currently running my Winforms app on Win7. My
I've currently got a spreadsheet type program that keeps its data in an ArrayList
I have a spreadsheet that I am importing that contains some test data for
I have hierchical data stored in a spreadsheet that I am converting into an

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.