+ Reply to Thread
Results 1 to 2 of 2

Windows Copy and Excel Paste, Rename columns, copy selected columns to new sheet and more.

  1. #1
    Registered User
    Join Date
    09-22-2014
    Location
    ZA
    MS-Off Ver
    2016 or 365
    Posts
    12

    Question Windows Copy and Excel Paste, Rename columns, copy selected columns to new sheet and more.

    Hi there, I need help please?

    I have a Workbook, however the VBA I use to copy columns from sheet "Temp" to "Analyse" does not order them into the correct order on paste. They appear in the order of the "Temp" sheet.
    The "Temp" sheet has many more columns that are pasted from a Windows App which is a problem too as I cannot seem to specify the whole "Temp" and "Analyse" sheets type as Text either and I have no control over the order of the columns that they are being copied from. "Temp" is also a hidden sheet. Rows can be anything from a couple to 2000.
    There are two Windows sources that are used, hence the rename column headers part added.

    I also have a sheet called "Search" with buttons on to make things easier. There is more to the spreadsheet that I have not included, but need assistance optimizing the code. I am using VLOOKUP to populate columns in the "Ananlyse" sheet which I would like to do with VBA instead, but that's for another day.
    I did considder INDEX and MATCH, but I need this to be fast due to a Query that runs and updates a table used for the VLOOKUP on opening the Workbook, that is already slow. I tried posting the workbook, but I'm developing on it and there is much that has changed since my inicial request. 1298478-a-combination-spreadsheet-as-database-userform-onsheet-userform-and-vba-to-do-stuff.

    So...

    I use this at the top of this Module "Utilities" and other code follows for compatibility and similar in other modules for other functions.

    Please Login or Register  to view this content.
    The Paste code from Windows clipboard is as follows, it has about 50 columns.
    Please Login or Register  to view this content.
    The code I am using to copy from one sheet to the other I found on another thread and adapted, is:

    Please Login or Register  to view this content.
    I have included the Rename part that is called during CopyColumns. It's quite rough, and I was busy trying to figure a better method.
    "Temp" is a hidden sheet.

    Please Login or Register  to view this content.
    For interest, my VLOOKUP is prepopulated in "Analyse" columns H:J from rows 1 to 2000, but shows a message if cells in column D has no value or is not an exact match. I need to figure a way to populate the VLOOKUP using xlUP or something along those lines.

  2. #2
    Registered User
    Join Date
    09-22-2014
    Location
    ZA
    MS-Off Ver
    2016 or 365
    Posts
    12

    Re: Windows Copy and Excel Paste, Rename columns, copy selected columns to new sheet and m

    Hi there. Anyone willing to give this a go? I am stumped on the copy columns range.
    I was thinking of defining each destination column as a named column.
    After renaming source column headers, defing those columns I need to copy and specifying the order in the destination definition.

    Please and thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Copy columns and paste them in another sheet every nth columns
    By johnjohnk in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-17-2018, 10:51 AM
  2. Copy columns from one sheet to new, rename headlines
    By Excelsemi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-30-2014, 07:50 AM
  3. How to copy selected columns from one sheet to another?
    By missy22 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-28-2014, 10:26 PM
  4. copy and paste columns in a specific order on a different excel sheet.
    By milkfloat in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2013, 01:36 PM
  5. Macro to copy selected columns, convert to number and paste to new tab
    By Greed in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-06-2011, 06:11 PM
  6. [SOLVED] Copy Selected Columns to Same Sheet
    By egavasrg in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-26-2011, 03:08 AM
  7. macro to copy paste selected columns in row
    By pvkkutty in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 07-03-2010, 06:54 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1