+ Reply to Thread
Results 1 to 6 of 6

Assistance with VBA CODE to find column on worksheet 1,copy contents of that column paste

  1. #1
    Registered User
    Join Date
    12-11-2012
    Location
    Seattle
    MS-Off Ver
    Excel 2007
    Posts
    51

    Assistance with VBA CODE to find column on worksheet 1,copy contents of that column paste

    HI,
    Need another pair of eyes. The below code is capturing the column heading as well as the data below the heading and pasting it into worksheet 2.

    How do I just have the code find the column heading in worksheet 1 then move to cell below the heading in column with data then scroll down column until it reaches an empty cell?

    Example is attached.

    Any help would be greatly appreciated! Thank you in advance!

    Due to time constraints I recorded a macro to get the majority of the code and I'm trying to tweak it from there. I'm trying to get the code to...

    capture the column heading on worksheet 2
    find that column heading on worksheet 1
    move to the first cell with data in that column
    capture all the data in that column stopping at the first empty cell
    paste in worksheet 2 in the column with the same name


    Here is my code
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Bevg; 07-31-2014 at 07:13 PM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Assistance with VBA CODE to find column on worksheet 1,copy contents of that column pa

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    Last edited by protonLeah; 07-31-2014 at 06:43 PM.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    02-22-2014
    Location
    Ireland
    MS-Off Ver
    Excel 2010
    Posts
    15
    You need to use counters and total counters to do this. There is a video/blog post on our site which explains more.

  4. #4
    Registered User
    Join Date
    12-11-2012
    Location
    Seattle
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Assistance with VBA CODE to find column on worksheet 1,copy contents of that column pa

    Would you happen to have the url of this "video/blog POST on our site". I did a search and it did not present a link to the video/blog.

    It would be really helpful because I'm getting compile errors on my loop as I try to loop through each column to copy the filtered rows and move them over to another worksheet.

    Here is my revamped code showing the problem with the loop syntax.
    Please Login or Register  to view this content.

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Assistance with VBA CODE to find column on worksheet 1,copy contents of that column pa

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    12-11-2012
    Location
    Seattle
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Assistance with VBA CODE to find column on worksheet 1,copy contents of that column pa

    Thank you, this worked and it was so simple. I was making it so hard. I just learned a new way of coding.

+ 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] Find string and copy/paste contents to different column, same row
    By rdowney79 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-04-2014, 06:18 PM
  2. [SOLVED] Trying to find the right code to copy a column from one worksheet and paste to another
    By mw91 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 11-15-2013, 01:57 PM
  3. Vba - find next empty column, insert column, copy paste values & copy paste formulas
    By DoodlesMama in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2012, 12:43 PM
  4. find copy and paste contents to another column
    By danbob in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-23-2009, 10:44 AM
  5. Macro to Find end of Column and paste Contents in Column 1
    By donnydorko in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-11-2009, 10:23 PM

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