+ Reply to Thread
Results 1 to 9 of 9

Macro to Transfer Selective Data

  1. #1
    Registered User
    Join Date
    02-13-2014
    Location
    Boston, United States
    MS-Off Ver
    Excel 2010
    Posts
    12

    Macro to Transfer Selective Data

    Hello,

    I need to write a code to accomplish a task in excel but I have almost zero VBA knowledge and I am trying to learn. If anybody could provide some guidance on how I would have to proceed it would be greatly appreciated.

    What I am trying to create is the following: I have a database with sales figures for store locations from 2000 - 2020. What I would like to happen is IF the sum of the values in the years (2000-2004) is equal to zero (because the stores had not yet opened), for excel to copy the corresponding store name(located in Column A) and paste it in Column A of a new tab (let's say Sheet2). Moreover, I need this to be such that every time that I run the macro the store names in Column A of Sheet2 get completely replaced by the new names but only for a certain range in the column.


    Any assistance would be highly appreciated.
    Last edited by chrixton; 02-18-2014 at 01:55 PM.

  2. #2
    Registered User
    Join Date
    02-13-2014
    Location
    Boston, United States
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Macro to Transfer Selective Data

    bump no response

  3. #3
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Macro to Transfer Selective Data

    You stated you are trying to learn. Would you like a complete solution or just hints?
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  4. #4
    Registered User
    Join Date
    02-13-2014
    Location
    Boston, United States
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Macro to Transfer Selective Data

    Hi Solus,

    Thank you for responding. I do want to learn, but I am also under pressure to get this done. As such, a complete solution would be very nice but would only hold me over until the next challenge. If you think it would be possible for me to get this done relatively quickly with almost zero VBA knowledge at the moment based on hints and direction, I would prefer hints. If you think it would take me a month or more to be able to accomplish this, I would prefer a complete solution. Either way I would be very grateful for any assistance you would be willing to offer.

  5. #5
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Macro to Transfer Selective Data

    Can you redact any sensitive information and post your spreadsheet?

    To attach a spreadsheet, click the 'Go Advanced' button below and then use the paperclip in the toolbar to navigate to your document.

  6. #6
    Registered User
    Join Date
    02-13-2014
    Location
    Boston, United States
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Macro to Transfer Selective Data

    So I can't upload the actual spreadsheet, but I created a simpler sample spreadsheet with random names and numbers that basically works in the same way.

    So to recap what I would need to happen is: in Sheet1, for each store IF the sum of the values in the years (2000-2004) is equal to zero (because the stores had not yet opened), for excel to copy the corresponding store name(located in Column A ( under "Store Name")) and paste it in Column A of Sheet2 under "Store Name". Moreover, I need this to be such that every time that I run the macro the store names already in Column A of Sheet2 get completely replaced by the list of new names but only for a certain range in the column. The reason I would want it only for a certain range in the column is because I have the TOTAL calculation in the bottom, so I would not want to accidentally erase that.

    Once the names are copied into Column A of Sheet 2, I have an INDEX-MATCH setup in Sheet2 that would match the sales figures from Sheet1. So basically I need to transfer the names to serve as an indicator for the INDEX-MATCH.

    So if the macro were to work, only the stores: Water, Garage, Telephone, Rockstar, and Hello Kitty would appear in Sheet2 under store names.
    Attached Files Attached Files
    Last edited by chrixton; 02-19-2014 at 05:06 PM.

  7. #7
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Macro to Transfer Selective Data

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    02-13-2014
    Location
    Boston, United States
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Macro to Transfer Selective Data

    wow, Solus thank you so much! It works great! I also like your solution for displaying a message box if the number of names will overwrite the Total. Thank you once again!

  9. #9
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Macro to Transfer Selective Data

    Glad to help!

+ 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] Writing a macro to collect data (selective) from multiple sheets to a summary sheet
    By hstuard in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-21-2013, 02:59 PM
  2. Replies: 1
    Last Post: 02-13-2013, 01:32 PM
  3. Macro to Pull Selective Data
    By Swordfish1989 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-31-2012, 08:37 PM
  4. Selective data transfer
    By BBoyAl in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-08-2012, 05:32 PM
  5. [SOLVED] Selective data transfer to other columns
    By Tom Cular in forum Excel General
    Replies: 4
    Last Post: 03-09-2006, 08:35 AM

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