Results 1 to 3 of 3

Add drop down list to cell dependent on value of other cell

Threaded View

  1. #1
    Registered User
    Join Date
    10-22-2014
    Location
    Hyde, Manchester
    MS-Off Ver
    2010
    Posts
    79

    Add drop down list to cell dependent on value of other cell

    Hi Guys,

    I am trying to edit a worksheet so that when you select certain values in cell D5 it will give you a dropdown box in E5 and if you select other values then it will simply give you the value "N/A"

    Through some googling it looked like the only way to do this was with a macro and what I have is here:

    Private Sub Worksheet_Change(ByVal Target As Range)
    Application.ScreenUpdating = False
    ActiveSheet.DisplayPageBreaks = False
    If Not Intersect(Target, Range("D5:D500")) Is Nothing Then
    Dim j As Integer
    For j = 5 To 500
    If Cells(j, 5) = "" Then
    If Cells(j, 4) = "ACB" Or Cells(j, 4) = "MCB" Or Cells(j, 4) = "MCCB" Or Cells(j, 4) = "MPCB" Then
    Cells(j, 5).Activate
    With ActiveCell.Validation
     .Add xlValidateList, xlValidAlertStop, xlBetween, "=$V$5:$V$7"
     .InCellDropdown = True
    End With
    Else
    Cells(j, 5) = "N/A"
    End If
    End If
    Next j
    End If
    End Sub
    However when I run this it does absolutely nothing..........

    Any help would be greatly appreciated!

    I have attached the sheet if its helpful and it is on the worksheet "Circuit Breakers"

    Thanks!

    Tom
    Attached Files Attached Files
    Last edited by tom.mat.walker; 05-28-2015 at 08:17 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Drop Down List Dependent on Cell Value
    By Aversin in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-31-2018, 03:10 PM
  2. [SOLVED] Dependent Drop down list with DEPENDENT DEFAULT VALUE
    By ginieman in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 10-28-2013, 03:56 AM
  3. [SOLVED] Code to put today's date in empty cell dependent on selection from drop-down list
    By vickyh1 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 08-28-2013, 09:09 AM
  4. [SOLVED] Dependent Drop down list with DEPENDENT DEFAULT VALUE (e.g. Blank)
    By Waqar Ali in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-26-2012, 06:31 AM
  5. Replies: 2
    Last Post: 05-12-2011, 09:23 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