+ Reply to Thread
Results 1 to 3 of 3

VBA code working with drop list with words instead of numbers

  1. #1
    Registered User
    Join Date
    05-29-2012
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    4

    VBA code working with drop list with words instead of numbers

    I have this code and it is working, but the drop list that I have in A1 have the values 1,2 and I want that works with the values "RIO","MAR".

    Option Explicit
    Private Sub Worksheet_Change(ByVal Target As Range)


    If Not Intersect(Target, Range("A1")) Is Nothing Then
    If IsNumeric(Target.Value) Then

    If Target.Value = 1 Then

    ActiveSheet.Shapes.Range(Array("Image2")).Visible = msoFalse
    ActiveSheet.Shapes.Range(Array("Image1")).Visible = msoTrue

    Else

    ActiveSheet.Shapes.Range(Array("Image2")).Visible = msoTrue
    ActiveSheet.Shapes.Range(Array("Image1")).Visible = msoFalse
    End If
    End If
    End If

    End Sub
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    863

    Re: VBA code working with drop list with words instead of numbers

    See the attachment
    rcasquinha.xlsm
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  3. #3
    Registered User
    Join Date
    05-29-2012
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: VBA code working with drop list with words instead of numbers

    Thank you 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. How to Convert this Code to Look for words instead of numbers
    By trevor2524 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-01-2013, 10:19 AM
  2. assigning numbers to a list of words
    By mtndoc in forum Excel General
    Replies: 0
    Last Post: 05-07-2013, 10:28 AM
  3. Code works with numbers only, not with words
    By MarcoAUA in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-15-2012, 12:44 AM
  4. code numbers so they display as words?
    By null42 in forum Excel General
    Replies: 2
    Last Post: 10-24-2011, 08:28 PM
  5. [SOLVED] Drop down list-->words=numbers?
    By Anonymous in forum Excel General
    Replies: 5
    Last Post: 02-22-2006, 12:10 AM

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