+ Reply to Thread
Results 1 to 2 of 2

Excel VBA For Creative Problem Solving Part 1 Assignment 4: Help Needed

  1. #1
    Registered User
    Join Date
    04-02-2024
    Location
    Munich, German
    MS-Off Ver
    Microsoft 365
    Posts
    1

    Question Excel VBA For Creative Problem Solving Part 1 Assignment 4: Help Needed

    INSTRUCTIONS: In the "Assignment 4 - STARTER.xlsm" file, you will find information for a bunch of batches from a certain process. Column A contains the Batch ID, Column B contains the production date, and Column C contains the ship date.

    The Batch ID has a two-digit code to the left of the hyphen and a 3- or 4-digit code to the right of the hyphen. The first letter of the Batch ID is known as the Identifier and the leading number of the 3- or 4-digit code to the right of the hyphen is known as the Key. For example, in the Batch ID "N9-363B", the Identifier is "N" and the Key is 3.

    Your goal is to create a subroutine that allows the user to select the Identifier from a drop-down menu in cell F2 and the Key from a drop-down menu in cell F3 (these drop-down/data validation menus are already available in the starter file) and any rows of the data (columns A, B, and C) whose Batch ID meets those criteria will be highlighted GREEN.

    The RUN button is linked to the HighlightRows subroutine in the starter file. The RESET button is already linked to the Reset subroutine in the starter file so please do not modify it. When run, the RESET button (or Reset sub) will remove any fill color/highlighting from anywhere on the "Data" sheet. However, it will not remove any additional rows that you may add, so be sure to reset the data (by copying/pasting) present in the "Original Data" tab if you add or change any of the original data.

    IMPORTANT: Also contained within the starter file are 3 additional procedures: 1) a sub called Example, 2) a function called Identifier, and 3) a function called Key. The Identifier function takes as an argument a Batch ID and outputs the Identifier. The Key function takes as an argument a Batch ID and outputs the Key. I encourage you to utilize these functions within your HighlightRows sub - you can see how to use these two functions in the Example sub.

    Requirements:

    1) When a match is found in a row, all three columns of data (columns A, B, and C) must be highlighted green.

    2) "Green" refers to the interior color index equal to 4. For example, Range("A1").Interior.ColorIndex = 4 would color cell A1 green. The grader file is specifically looking for this ColorIndex! If you color the cells a different shade of green, it won't pass the grader!

    3) When additional rows are added to the data (for example, in row 27 and beyond), your sub should automatically detect the size of data (number of rows) and adjust accordingly.

    Hints

    I would recommend using the Range approach to working with data arrays such as this. See the screencast "Iterating through a Selection vs. a Range" and pay close attention to the approach using Range instead of Selection.

    Note that in the starter file, cell F2 has been named "identifier" and cell F3 has been named "key".


    I do not understand what is my mistake, can you please help me? Only Sub Highlight Rows() is created by my own, the others are created by Instructor.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by chollerauer; 04-09-2024 at 08:18 AM.

  2. #2
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,027

    Re: Excel VBA For Creative Problem Solving Part 1 Assignment 4: Help Needed

    All you need is this...

    Please Login or Register  to view this content.
    Last edited by Sintek; 04-04-2024 at 02:50 AM.
    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 [★ Add Reputation] to left of post window...
    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. Excel VBA For Creative Problem Solving Part 1 Assignment 4
    By chiky1972 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-14-2025, 10:35 AM
  2. Excel VBA For Creative Problem Solving Part 1 Assignment 4
    By YuliaUK in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-16-2024, 12:52 PM
  3. Excel VBA For Creative Problem Solving Part 1 Assignment 4
    By Astec in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-19-2023, 05:31 PM
  4. VBA Excel part 1 Assignment 1
    By boonodno in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-14-2023, 06:35 AM
  5. Help Needed: Excel VBA For Creative Problem Solving Part 1 Assignment 4
    By webcam723 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-04-2023, 08:28 PM
  6. Replies: 10
    Last Post: 12-28-2020, 05:02 AM
  7. Bit of Problem Solving Needed Please!
    By lashz78 in forum Excel General
    Replies: 3
    Last Post: 03-07-2017, 06:36 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