+ Reply to Thread
Results 1 to 7 of 7

macro to validate cells are filled before going to next row.

  1. #1
    Registered User
    Join Date
    05-11-2007
    Posts
    93

    Question macro to validate cells are filled before going to next row.

    Hi all,
    I want to know how can i write a macro which validates the current row before moving to another.

    for example if the user is in the row number 3 and he clicks on row 10. i want to run a macro which validates if certain fields are filled in row number 3 before he goes to row 10.

    How can i do it?

  2. #2
    Forum Contributor Stuie's Avatar
    Join Date
    09-17-2006
    Location
    Suffolk, UK
    MS-Off Ver
    Excel 2003/2007
    Posts
    432
    hey ballack....

    yea this is posible, how many or whats fields do you want to check and what you want to check them for??

  3. #3
    Registered User
    Join Date
    05-11-2007
    Posts
    93
    Stuie, I want to check for around 4 columns in that row .
    I want to check for eg. if say Col A has certain value then the col B should have a specific value.

    thank you.

  4. #4
    Registered User
    Join Date
    05-11-2007
    Posts
    93

    Question

    Can anyone help me with this?

  5. #5
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    ballack

    Your messages are lacking detail of what is required.

    Until you provide a full list of what is required & what conditions have to be met you will only get vague & generalised responses
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  6. #6
    Registered User
    Join Date
    05-11-2007
    Posts
    93
    ok,
    I have a Column called Country and a column called State .
    And the validations i have to do is

    1).if the country is USA then State must be specified.

    If the State is not specified i must send a pop up message when user tries to moves to next cell and the user must not be allowed to move to next cell.

  7. #7
    Forum Contributor Stuie's Avatar
    Join Date
    09-17-2006
    Location
    Suffolk, UK
    MS-Off Ver
    Excel 2003/2007
    Posts
    432
    Hi... i have done a quick example of what you could do...

    in A1 is Country and B1 is State.

    Please Login or Register  to view this content.
    That is a very basic way of doing this task. You can paste that staight into you workbook code page. also this based on the the user entering a country in col A and hitting enter or selecting the next cell down in col A
    Last edited by Stuie; 05-24-2007 at 09:10 AM.

+ 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