+ Reply to Thread
Results 1 to 6 of 6

Copying a range of data in a column and pasting to another sheet

  1. #1
    Registered User
    Join Date
    04-08-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    76

    Copying a range of data in a column and pasting to another sheet

    I am trying to copy a range of data in a column, where not every row has data, and paste it into a column in another sheet, but I only want to paste the rows that have data. please see the attached sample. i want to copy from Range M8:M247 (or from M8 to the last row of data in column M. Please provide code for both.) in Sheet1 and paste just the data rows starting in Cell B2 on Sheet2. this would then have hexidecimal data corresponding to each Cycle in Column A of Sheet2. FYI, the data in Sheet1 cell M7 has already been parsed through and put into columns as headers starting in column B of sheet2, so it is intentional that I started with an empty cell (M8) for the data I wish to copy. Thanks in advance for your help!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Copying a range of data in a column and pasting to another sheet

    hi JP777, option, code "test" - till last value in M column, code "test1" - for fixed hardcoded range
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    04-08-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: Copying a range of data in a column and pasting to another sheet

    watersev,
    Thanks for the reply. your code is working in the sample sheet, but it doesn't work when I copy and paste it into my project. Are there any differences between Excel 2003 and 2007 that may be factoring into it?

  4. #4
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    882

    Re: Copying a range of data in a column and pasting to another sheet

    Thought I would still post it as I had already written it.
    Please Login or Register  to view this content.
    Last edited by WasWodge; 04-21-2012 at 06:23 PM.
    If my solution worked (or not) please let me know. If your question is answered then please remember to mark it solved

    Computers are like air conditioners. They work fine until you start opening windows. ~Author Unknown

  5. #5
    Registered User
    Join Date
    04-08-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: Copying a range of data in a column and pasting to another sheet

    WasWodge,
    Works like a charm. Thanks

    Now that I have the hex data in place, I am going to convert it to binary and convert text to columns for each binary bit. The problem is, I can't figure out how to convert text to columns for one letter/number/character at a time. Any thoughts?

  6. #6
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    882

    Re: Copying a range of data in a column and pasting to another sheet

    Afraid I don't in VBA. In formula try
    in C2 =LEFT(B2,1) dragged down
    in D2 =MID($B2,COLUMN(B2),1) dragged across and down

  7. #7
    Registered User
    Join Date
    04-08-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: Copying a range of data in a column and pasting to another sheet

    I see how that works. I will still try to figure it out with VBA as well. Thanks again for the help!

+ 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