+ Reply to Thread
Results 1 to 3 of 3

Copy data if cell has value in it

  1. #1
    Registered User
    Join Date
    02-04-2013
    Location
    Buffalo, New York
    MS-Off Ver
    Excel 2010
    Posts
    27

    Copy data if cell has value in it

    Hello,

    I am looking for help with a macro so I can easily sort and see data.

    I have a spreadsheet with rows 1 and 2 containing item information. Rows 3-93 have the ordering information. For every row in 3-93, if there is a value in any column in between F and VU, copy the the corresponding value in columns A,B,C for that row to a new sheet called Orders and copy the corresponding values in rows 1 and 2 for that column.

    for example, I need this:

    Please Login or Register  to view this content.
    Copied over to a new sheet called Orders, like this:

    Please Login or Register  to view this content.

    I am struggling with the VBA logic and can't seem to get it work right. Any help or advise is greatly appreciated.

    Thanks!
    Last edited by mweick; 02-14-2014 at 11:51 AM.

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Copy data if cell has value in it

    In the future, please include a larger sample set. While your example is ample enough to indicate you desired results, testing on such a small sample usually doesn't show any errors, while a larger set might. If unsure, you can always add a sample workbook. (Perferred)
    Please Login or Register  to view this content.
    This code is dynamic, meaning it will determine last row and last column of the source sheet. So if you have more of fewer rows/columns, it should account for that.
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    02-04-2013
    Location
    Buffalo, New York
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Copy data if cell has value in it

    @TinBendr Thanks for showing me the logic behind the VBA on a function like this! I will study and note for the future. This is going to greatly help me, and thanks for briefly describing the logic behind this function!

+ 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] Formula Needed to copy data from a cell based on data entered into another cell
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-10-2013, 03:16 AM
  2. [SOLVED] If data entered in cell, on same row, copy and paste data from other cells to front sheet
    By Christopher135 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-27-2013, 06:34 PM
  3. [SOLVED] Copy data with 4 cell interval and copy range of data like vlookup with structured output
    By Daydreams in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-23-2013, 04:08 AM
  4. [SOLVED] How to copy data in a cell in Sheet1 to a cell in Sheet2 using =COPY( )?
    By Mr D Relf in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 07-17-2013, 10:39 AM
  5. Replies: 3
    Last Post: 07-15-2010, 08:49 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