+ Reply to Thread
Results 1 to 8 of 8

How to skip an entire column when copy pasting from another sheet

  1. #1
    Registered User
    Join Date
    06-15-2013
    Location
    usa
    MS-Off Ver
    Excel 2010
    Posts
    21

    How to skip an entire column when copy pasting from another sheet

    Good morning all!
    I am in need of some assistance I have this macro below that copies cells from "Import_file" to "Master Inst List". The infomation in the "Import_file" sheet is brought in from a .txt file that is generated by AutoCAD and then brought into excel. The macro looks for the record no. (column B) in the "Import_file" and then looks for that same record no. in the "Master Inst List". When the macro finds a match it copies the entire row related to that record no. and pastes it into the matching record no. it found.


    Please Login or Register  to view this content.
    Here is my question.......... I would like the macro to copy and paste all of the columns in the row related to the matching record no. except for column H. Is there a way to have to tell the macro to copy all rows but to skip over column H? Am I making any sense???

    I hope you can help! I have pasted my worksheet below
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: How to skip an entire column when copy pasting from another sheet

    Hi,

    this is not skipping the column where your formula is but it will insert the formula in the column, performance improved:
    Please Login or Register  to view this content.
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  3. #3
    Registered User
    Join Date
    06-15-2013
    Location
    usa
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: How to skip an entire column when copy pasting from another sheet

    Thanks that work so great!! Could you possibky help with one more thing? At times I need the information to go the opposite direction from the "Master Inst List" to the "Import_file". I have a similar code to the original one I posted but sometimes it leaves numbers out....... I tried to modify your code you did but it wasnt working right.

  4. #4
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: How to skip an entire column when copy pasting from another sheet

    Hi,

    few questions on that:
    1. Do you want to copy ALL records from "Master Inst List" to "Import_file" or is there the "REC_NO" in "Import_file" already to match? or do you want to enter a range of "REC_NO"?
    2. Are there headings prepared in "Import_file"?
    3. Column A "HANDLE" is not in "Master Inst List", what to do?

  5. #5
    Registered User
    Join Date
    06-15-2013
    Location
    usa
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: How to skip an entire column when copy pasting from another sheet

    Thanks again for your help

    So here is the breakdown.......
    I have a .txt file that I import into Excel that was original generated by information in AutoCAD and I read and write to this txt file from the Excel workbook. The record no. is what I am using to "link" files from one sheet to another. So both the "Import_file" and the "Mast Inst List" both have this record number listed in the "B" column of their sheets. I had 2 macros that I was using, one for moving info from the "Import_file" to the "Master Inst List" and another for moving the information from "Master Inst List" to the "Import_File". I was having an issue with needing to replace that formula in column "H" of the "Master Inst List" after I ran the macro to move information into the "Master Inst List". The macro that you shared with me (thanks again!) I am now using to move info from the "Import_File" to the "Master Inst List" and it is great! Now I am having issues with the macro I have for moving information from the "Master Inst List" to the "Import File". It seems to work for the most part but for somereason it will randomly leave certain record numbers out of the transfer and I cannot figure out why. That is why I was hoping to use that code you shared just in reverse (from "Master Inst List" to "Import_file"). I have been told to use VLOOKUP() but I cannot have code in the "Import_file" because I have to import that information back into AutoCAD.

    This is the code I am using to move files from "Master Inst List" to "Import File", but I would like to use something similar to what you shared with me...... It seems to work better!

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    06-15-2013
    Location
    usa
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: How to skip an entire column when copy pasting from another sheet

    Oh sorry the handle is a number that autocad need to read. I used your code and modfied it to bring that into the "Master Inst List" so that when I move info from the "Master Inst List" to the "Import File" that HANDLE does not get lost. It is what AutoCAD uses to recognize the information.....

  7. #7
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: How to skip an entire column when copy pasting from another sheet

    Hi,

    this is basically the same code but copies the other way around. Please pay attention to the sorting as your Record ID's are changing whenever you sort and therefore the match will change, maybe remove the sort from code. Workbook is saved at the end and kept open.

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    06-15-2013
    Location
    usa
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: How to skip an entire column when copy pasting from another sheet

    BEAUTIFUL!!! I took the sort function out. I thought I needed it to ruin through the numbers but I see that it was just hurting me I cannot thank you enough!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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