+ Reply to Thread
Results 1 to 8 of 8

VBA to copy cells based off of other data

  1. #1
    Registered User
    Join Date
    08-12-2011
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    8

    VBA to copy cells based off of other data

    First off, I've scoured this site for hours and haven't found something that works for me. If I've overlooked the post, whoops!

    I've attached an example file of what I'm trying to do to help explain...

    I want to take anything on the "Questions" sheet where the answer is "Y", and copy it to the "Summary" under the appropriate column header based off of the category on the "Questions" sheet.

    Thanks in advance,
    Alan
    Attached Files Attached Files

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: VBA to copy cells based off of other data

    Try this code

    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    08-12-2011
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: VBA to copy cells based off of other data

    That worked, Thanks!

    Another Question though - just to take this to the next level.


    I've attached another example of the issue I'm having now. I've worked at this all day with no progress. I want to do the same thing in the post before, but have several rows above that I've added and think it's screwing it up.
    Attached Files Attached Files

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: VBA to copy cells based off of other data

    So, will there always be like 3 categories in columns A to C and 1 below?

  5. #5
    Registered User
    Join Date
    08-12-2011
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: VBA to copy cells based off of other data

    yes. The cells may not necessarily be the first 3 cells (A1,B2,C3) but there would be three columns on top and one below.

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: VBA to copy cells based off of other data

    So does the macro have to look for a particular field to identify where the data starts for the 1st column? In other words, does it have to look up certain header values to identify that it is the header and then proceed?

  7. #7
    Registered User
    Join Date
    08-12-2011
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: VBA to copy cells based off of other data

    The headers on the "summary" page would be static and would never change

  8. #8
    Registered User
    Join Date
    08-12-2011
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: VBA to copy cells based off of other data

    Anyone help me?

+ 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