+ Reply to Thread
Results 1 to 5 of 5

How to prevent to go to the other sheet

  1. #1
    Forum Contributor
    Join Date
    11-21-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    190

    How to prevent to go to the other sheet

    Hi,
    I want users to move the sheet after they insert required columns.
    When they click the other sheet, I want to show message box and it says ' You didn't finish yet.'
    For example, when I don't insert all data in required column in Sheet1, when I click Sheet2 , message box will be popped up.

    My required column is column J and starting row is 6, but last row is not known in Sheet 1.
    If cell (6,"J").Value <>"" then,(this means something in this cell)
    I want users to ask fill out every cells in row 6 if they omit some cells in row 6.
    If users ignore , and then go to Sheet 2 , then I want to display message box to warn them.

    Any advise appreciated
    Thanks

  2. #2
    Registered User
    Join Date
    09-17-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: How to prevent to go to the other sheet

    Method1:
    Eithere you can hide all rows/columns in that particular sheet and on that particular sheet's Activate event write a code to check the columns are filled or not. If filled unhide all rows/columns and if not then show a message to the user "You didn't finish yet." and activate the data sheet.

    Method2:
    When user go to the next sheet write a code in sheet activate event which will check the particular condition

    Method3:
    Make very hidden or simply hide the sheet and provide a button in data sheet which will redirect to the next sheet and write code to check the condition and if condition is true then make that sheet visible or else show your messge.

  3. #3
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: How to prevent to go to the other sheet

    It's unclear what you really want to do.
    How many columns/cells within a row is mandatory?
    Are you going to loop through every (entered) row,
    or stopping just after checking row 6?

    This (ultra basic code) could be a start, place it within Sheet1's code:
    Please Login or Register  to view this content.
    多么想要告诉你 我好喜欢你

  4. #4
    Forum Contributor
    Join Date
    11-21-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    190

    Re: How to prevent to go to the other sheet

    Thanks.
    I have to loop through every row and add code in worksheet deactivate, then worked.
    Thanks1

  5. #5
    Forum Contributor
    Join Date
    11-21-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    190

    Re: How to prevent to go to the other sheet

    Thanks for your help.

+ 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. Macro to prevent printing specific sheet based on cell value in another sheet
    By dbrady01 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-24-2013, 04:23 PM
  2. Replies: 9
    Last Post: 05-13-2013, 05:43 AM
  3. Prevent code in "Sheet Activate" from running when sheet made visible from other macr
    By Simon Lloyd in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-21-2006, 04:15 AM
  4. Replies: 2
    Last Post: 01-12-2006, 10:35 PM
  5. [SOLVED] Prevent sheet add or delete
    By Glen Mettler in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-22-2005, 02:06 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