+ Reply to Thread
Results 1 to 12 of 12

VBA – Make a row mandatory by a pull down with different words

  1. #1
    Registered User
    Join Date
    07-20-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    44

    VBA – Make a row mandatory by a pull down with different words

    I already have a few codes in my Excel document. I wanted to piggie back on code for a workbook before save.

    I have a pull down that has different words. The pull down indicated server types for example database, reporting servers. What I'm looking for is when the pull down is use mandatory before a save.

    The row is B1 - J1

    B1 represents the pull down. I tried to change code I already have setup but that was unsuccessful because it is for a true/false statement. Any help would be lovely!! Thank you in advance.

    Elizabeth

  2. #2
    Forum Contributor IonutC's Avatar
    Join Date
    01-28-2016
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2019
    Posts
    486

    Re: VBA – Make a row mandatory by a pull down with different words

    Well you can do something like this..


    Please Login or Register  to view this content.
    if you can post your code, we can help more, because we can see your actual code and see how we can tweak it etc...
    Please consider:
    Be polite. Thank those who have helped you.
    Click the star icon in the lower left part of the contributor's post and add Reputation. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .
    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Posting code between tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

  3. #3
    Registered User
    Join Date
    07-20-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    44

    Re: VBA – Make a row mandatory by a pull down with different words

    This is my true/false code:

    If Worksheets("Integrations").Range("A46") = True Then
    If Worksheets("Integrations").Range("G47").Value = "" Or _
    Worksheets("Integrations").Range("G29").Value = "" Then
    MsgBox "Please fill out these required fields on Integrations tab that are highlighted in blue."
    Cancel = True
    Exit Sub
    End If
    End If

    This is what I thought I could change the True/false code to:

    If Worksheets("Servers").Range("B7") = Enterprise Then
    If Worksheets("Servers").Range("C7").Value = "" Or _
    Worksheets("Servers").Range("D7").Value = "" Or _
    Worksheets("Servers").Range("E7").Value = "" Or _
    Worksheets("Servers").Range("F7").Value = "" Or _
    Worksheets("Servers").Range("G7").Value = "" Or _
    Worksheets("Servers").Range("H7").Value = "" Or _
    Worksheets("Servers").Range("I7").Value = "" Or _
    Worksheets("Servers").Range("J7").Value = "" Then
    MsgBox "Please fill out these required fields on Servers tab that are highlighted in blue."
    Cancel = True
    Exit Sub
    End If
    End If

    But i was wrong.

  4. #4
    Forum Contributor IonutC's Avatar
    Join Date
    01-28-2016
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2019
    Posts
    486

    Re: VBA – Make a row mandatory by a pull down with different words

    FIrst you have to use code tags.
    http://www.cplusplus.com/forum/articles/42672/

    I don;t understand what you need to do if cell A46 is true. The same for cell B7. After Then you need at next line to write a code that is doing an action.

    Like

    If your eyes are green Then
    You should go and shop
    Elseif you should go home.

    This is the basic of If statements and that is why I am asking you to provide details about the action you want to perfom if in those cells are the required string.

    Also you can post your workbook by clicking Go Advanced and than you can upload a document.
    Last edited by IonutC; 09-27-2016 at 11:42 AM.

  5. #5
    Registered User
    Join Date
    07-20-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    44

    Re: VBA – Make a row mandatory by a pull down with different words

    This time it is not a true false statement. i need to have the row mandatory by a specific word from a pull down. Does that make sense?

  6. #6
    Forum Contributor IonutC's Avatar
    Join Date
    01-28-2016
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2019
    Posts
    486

    Re: VBA – Make a row mandatory by a pull down with different words

    nope! pls attach a file...

  7. #7
    Registered User
    Join Date
    07-20-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    44

    Re: VBA – Make a row mandatory by a pull down with different words

    I wasn't able to add a file but I added a screenshot.

    The pull down under server type is what needs to run the mandatory rows.

    Excel Document Example.png
    Last edited by bees2cute; 09-27-2016 at 04:23 PM. Reason: added file

  8. #8
    Registered User
    Join Date
    07-20-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    44

    Re: VBA – Make a row mandatory by a pull down with different words

    Does the screenshot make sense?

  9. #9
    Forum Contributor IonutC's Avatar
    Join Date
    01-28-2016
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2019
    Posts
    486

    Re: VBA – Make a row mandatory by a pull down with different words

    so if the cell value from B4 is Server Type then what action you want to do?

  10. #10
    Registered User
    Join Date
    07-20-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    44

    Re: VBA – Make a row mandatory by a pull down with different words

    If the B4 = database, then I need the whole row (B4 through J4) associated with database to become mandatory row that needs to be file in before saving the document. Does that make sense?

  11. #11
    Forum Contributor IonutC's Avatar
    Join Date
    01-28-2016
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2019
    Posts
    486

    Re: VBA – Make a row mandatory by a pull down with different words

    ok!

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    07-20-2016
    Location
    USA
    MS-Off Ver
    2016
    Posts
    44

    Re: VBA – Make a row mandatory by a pull down with different words

    Hi sorry! I'm so late at responding.

    I was unsuccessful at getting the code to work.

+ 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. How to make data in cells mandatory?
    By r.kondapalli in forum Excel General
    Replies: 8
    Last Post: 01-18-2011, 11:30 AM
  2. Replies: 3
    Last Post: 02-06-2006, 07:10 PM
  3. [SOLVED] How can I make a cell mandatory and only accept a Y or N?
    By Ron Rosenfeld in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 07:05 AM
  4. [SOLVED] How can I make a cell mandatory and only accept a Y or N?
    By Ron Rosenfeld in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 06:05 AM
  5. How can I make a cell mandatory and only accept a Y or N?
    By Vicki in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  6. [SOLVED] How can I make a cell mandatory and only accept a Y or N?
    By Vicki in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  7. How can I make a cell mandatory and only accept a Y or N?
    By Vicki in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-23-2005, 03:05 PM

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