Closed Thread
Results 1 to 2 of 2

VBA to select specific Text in Drop Down List

  1. #1
    Registered User
    Join Date
    08-01-2011
    Location
    North Carolina, USA
    MS-Off Ver
    Excel 2010
    Posts
    17

    VBA to select specific Text in Drop Down List

    Hello. I am trying to figure out the VBA to select specific values in a drop down list already created in my spreadsheet.

    What I am doing overall: I have a drop down list of six cities (in C5) that triggers the re-calculation of cell D18 (which is sales for that particular city). I need a macro that selects the cities one at a time, then copies the sales value for each one in D18, then pastes the values in a different sheet that I named "Datos".

    I recorded a macro manually and got the following VBA, but it does not differentiate when I selected something different in the drop down list. Please help!!



    Sub CopyAllRegionsUnidadesActual()
    '
    ' CopyAllRegionsUnidadesActual Macro
    '

    '
    Range("D18").Select
    Selection.Copy
    Sheets("Datos").Select
    Range("E46").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Sheets("Herramienta").Select
    Range("D18").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Datos").Select
    Range("E47").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Sheets("Herramienta").Select
    Range("D18").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Datos").Select
    Range("E48").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Sheets("Herramienta").Select
    Range("D18").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Datos").Select
    Range("E49").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Sheets("Herramienta").Select
    Range("D18").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Datos").Select
    Range("E50").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Sheets("Herramienta").Select
    Range("D18").Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Datos").Select
    Range("E51").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    End Sub

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: VBA to select specific Text in Drop Down List

    Welcome to the Forum, unfortunately:

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.
    http://www.excelforum.com/excel-prog...down-list.html
    Thread Closed.

Closed 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