+ Reply to Thread
Results 1 to 8 of 8

Macro to find value, and alert if conditions arent met

  1. #1
    Registered User
    Join Date
    01-14-2011
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    12

    Macro to find value, and alert if conditions arent met

    Hello

    I have a column of data (accounts) that at times can be very long. If the amount in the (account) column is a certain value [1520], there must be data in a nearby column (project), unless it is in a certain (group).

    Easyist put:
    Account 1520 is what the search is for. If it find thats, then it needs to look at the project cell and see if there is any data. The project cell can be left blank only if on the same row, the column named (groups) contains either 1,2,3,4,5 nothing else.

    If it is not 1-5 it can not be blank in the project column.

    If there is an error where the 1520 is found, and the project is blank and it shouldnt be, I want a popup alert.

    I imagine this could be done with a simple if then, however the file is a template that users fill in and mail to me, therefore changing rows and columns isnt an option, as it might also currupt the upload into the data system.

    Anyone have ideas? Does this make sense?

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Macro to find value, and alert if conditions arent met

    Hi,

    It would help if you could provide a sample workbook showing the layout that you are using.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    01-14-2011
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Macro to find value, and alert if conditions arent met

    here is an example.. its not the actual file, but gets the point..
    Attached Files Attached Files

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Macro to find value, and alert if conditions arent met

    Something like this maybe:

    Please Login or Register  to view this content.

    Dom

  5. #5
    Registered User
    Join Date
    01-14-2011
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Macro to find value, and alert if conditions arent met

    Dom,

    Thanks for your help. I should have specified which might make this a little easier. The input cells for "Groups" starts at E18, "Accounts" start at G18, and "Projects" start at J18.

    To make this slightly more difficult, the Accounts that dont require projects are not as easy as 1-5, I would need to manually enter in 14 different "group numbers"

    Also, since the account number wont change, is there a way to make the inputbox account always the same rather than manually entering it each time the macro is ran?

    Thanks soo much!

  6. #6
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Macro to find value, and alert if conditions arent met

    No worries fella. I'm out for evening now but will look again tomorrow. Can you maybe put together another sample?

  7. #7
    Registered User
    Join Date
    01-14-2011
    Location
    NY
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Macro to find value, and alert if conditions arent met

    here is a better example.. if the range for group is editable so I can specify which group numbers are allowed to not have a project.
    Attached Files Attached Files

  8. #8
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Macro to find value, and alert if conditions arent met

    Try this:

    Please Login or Register  to view this content.

    Dom

+ 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