+ Reply to Thread
Results 1 to 7 of 7

Worksheet change event for range of cells and data validation

  1. #1
    Registered User
    Join Date
    01-02-2012
    Location
    Pune, India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Worksheet change event for range of cells and data validation

    Hi All,

    I have some issues while working on Worksheet change event for range of cells.
    I have one sheet in which user have to update required fields and
    click on send email command button which sends mail.
    I have assigned sending email macro to command button And other data is stored from range A4:H7(this range is not constant.May
    vary in other sheets).
    Now there are three last columns and Send email command button for which i need help
    Column F-- Status Column-- Data validation is done so only allows values Active or Inactive
    Coolumn G- Effective Inactive Date--This column is blank. This value should be entered when column F values is selected as
    Inactive.
    Column H - Review -- Data validation is done so only allows values Yes or No

    Now I require following things working:
    1. Column F:Status Column --> a. If user selects Inactive value then message box should pop up asking user to enter susbsequent Effective Inactive Date value.

    b.Also want subsequent Effective Date value made mandatory for user if status is Inactive.

    c. If field in this column is left blank then Command button(here SendEmail) button should not work and one message box should pop up upon clicking command button asking user to update require fields


    2. Column H: Status -->
    a. If field in this column is selected as No or left blank then Command button(here SendEmail) button should not work and one message box should pop up upon clicking command button asking user to update require fields


    Please help me out as this issue is really freaking me out.
    Last edited by santosh123; 01-08-2012 at 07:40 AM. Reason: change

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Worksheet change event for range of cells and data validation

    Hi santosh123
    To get working code it'll be best if you posted a sample file of your data with an explanation of what you wish to accomplish. Having done that I'm certain one of us can help you.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    01-02-2012
    Location
    Pune, India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Worksheet change event for range of cells and data validation

    PFA sample file.

    This is the workbook which I will send to users. User then will open this file and update field and click on send mail button to send back workbook to me.
    I have assigned Send mail macro to command button. This macro will send mail back to me once user updates all fields and click on this button.

    Before clicking on command button I want users to update columns Status(Column F), Review (Column H) and Effective Inactive Date(Column G). Please not that updating values of Effective Inactive Date are mandatory only if user enters value Inactive in adjancent column 'Stasus'.

    I have done data validation for Status column(allows only Active or Inactive value) and Review column(allows only Yes or No values). Please see that.

    Please check below my requirements:
    1. Command button must be disabled if user has not updated required fiels. Required fiels are Status Column and Review Column

    1. Column F:Status Column -->
    a. If user selects Inactive value then message box should pop up asking user to enter Effective Inactive Date value in adjacent column H(Effective Inactive Date column)

    b.And if user has not updated Effective Date column then again command button should not work. This means Effective Inactive values should be mandatory if user enters status as Inactive in Status column.

    c. If field in Status column is left blank then Command button(here SendEmail) button should not work and one message box should pop up upon clicking command button asking user to update require fields


    2. Column H: Review Column -->
    a. If user enters value in this column as No then again command button should not work. One message box should pop up asking user to review required field again.



    Please let me know in case any further information is required. And guys please help me to solve this problem as I am new to Worksheet_change event.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Worksheet change event for range of cells and data validation

    hi santosh123, option to make it, please check attachment, press send Mail

    123_sample_file(11).xls - without Conditional Format being used
    123_sample_file(1).xls with Conditional Format being used
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-02-2012
    Location
    Pune, India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Worksheet change event for range of cells and data validation

    Thanks Watersev for your gr8 help.
    I am very thankful for that.
    the 1st file with conditional format resolved my issue.
    Could you please also provide macro for conditional format. I am not able to do this on my own.
    Once again thanx for youy great help.

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Worksheet change event for range of cells and data validation

    code for conditional format:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-02-2012
    Location
    Pune, India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Worksheet change event for range of cells and data validation

    Thanks Watersev. Thanks for your gr8 help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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