+ Reply to Thread
Results 1 to 2 of 2

Private Sub Worksheet_Change(ByVal Target As Range)

  1. #1
    Registered User
    Join Date
    06-13-2013
    Location
    Charleston, SC
    MS-Off Ver
    Excel 2010
    Posts
    75

    Private Sub Worksheet_Change(ByVal Target As Range)

    [Solved]

    [I created a drop down list and defaulted it to No. If the value is Y, it unhides the cells. I also had to add code for unprotecting/protecting sheet since it was protected.]
    **********************
    I cannot get this code to work.

    What I want to do is to have rows 35-36, 40-41 and 45-46 unhidden when age is 50 or greater. By default on my inputs screen I have these rows hidden.
    I have an inputs screen on my workbook and I use a "reset inputs" macro so the cell for calculated age has to be referenced.

    cell b5= date of birth
    Cell b6=by13 and cell b6 is protected since it is a calculated age
    Cell BX13 = year(b5)
    Cell BY13 =IF(YEAR(BW13)-BX13>100,0,YEAR(BW13)-BX13)

    This code does not "unhide" my rows 35-36, 40-41 and 45-46 when calculated age is 50 or greater. Note, I need to combine it with the other code for b19 which already worked.

    Please Login or Register  to view this content.

    Thanks
    Hank
    Last edited by hmr2662; 06-25-2015 at 10:22 AM. Reason: solved

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Private Sub Worksheet_Change(ByVal Target As Range)

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

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

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

+ 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. Private Sub Worksheet_Change(ByVal Target As Range)
    By BigJim68 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-27-2014, 01:57 PM
  2. [SOLVED] Private Sub Worksheet_Change(ByVal Target As Range) End Sub
    By kanonathena in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-10-2013, 12:25 AM
  3. [SOLVED] Private Sub Worksheet_Change(ByVal Target As Range)
    By Hilton1982 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-18-2012, 01:13 AM
  4. [SOLVED] Private Sub Worksheet_Change(ByVal Target As Range)
    By Arturo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-25-2005, 11:06 AM
  5. Private Sub Worksheet_Change(ByVal Target As Range)
    By bondcrash in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-11-2005, 02:59 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