+ Reply to Thread
Results 1 to 3 of 3

Need help writing a Macro to return multiple entries given an account ID and sales days

  1. #1
    Registered User
    Join Date
    03-27-2017
    Location
    Chicago, Illinois
    MS-Off Ver
    2007
    Posts
    1

    Need help writing a Macro to return multiple entries given an account ID and sales days

    Hello,

    I'm rather new to VBA coding and would like to get some help writing a macro.

    I have a workbook with account numbers in Column D. These ID numbers are what we use as our unique identifier.

    In workbook columns J through N we have delivery day columns (M = Monday, T =Tuesday, all the way through Friday). Salesmen then go and enter a 1 in that column if they want an account to be delivered to on that day.

    I'm having trouble when it comes to requests to deliver to an account twice a week. For example an account wants to receive a delivery on Tuesday and Friday.

    My ask is to please help me write a macro to return the account ID listed in Column D, in Column A on a new tab and to return a day number in Column B if they put a 1 in columns J through N (Monday would be 1, Tuesday 2, etc). If an account wants multiple delivery days there would have to be multiple account ID's with their own entry. For example

    Acct "HID99999" wants a delivery on Monday and Thursday, I would need the following returned:

    Column A Column B
    HID99999 1
    HID99999 4




    If anyone could please help me out with this, it would be greatly appreciated.

    Thanks.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Need help writing a Macro to return multiple entries given an account ID and sales day

    Welcome to the forum. Unfortunately, your requirements are not clear. You have the advantage of knowing what your workbook, data and formulae look like; we do not. Do you have any code? How do you select the unique ID? Where do you want the selected entries output?

    I suggest that you upload a sample workbook with some typical data, describe the process, and mock up your expected output.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Need help writing a Macro to return multiple entries given an account ID and sales day

    Hi thstevens

    This will do the trick. Assuming data is in Sheet1 and result in sheet2.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sintek; 03-28-2017 at 01:01 AM. Reason: Forgot to upload result sample file
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

+ 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. Replies: 6
    Last Post: 01-27-2016, 07:38 AM
  2. Need macro to search multiple data points from multiple entries and return single value
    By Redbullmoo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-11-2013, 02:16 AM
  3. [SOLVED] Calculate number of days between sales and prior sales date
    By maacmaac in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-03-2013, 03:07 PM
  4. Return Account Nickname if Account Number Matches
    By spacle in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-03-2013, 11:04 AM
  5. [SOLVED] AVERAGE value from past 5 days - multiple entries
    By jj554 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-11-2013, 09:54 PM
  6. Replies: 1
    Last Post: 09-20-2012, 06:05 PM
  7. Return Time since last account balance Change using Macro
    By Lewis2010 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2011, 05:30 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