How to change value which add from dropdown list from number to text

35 Views Asked by At

I created a data entry form which consists of a dropdown list with the country name.

However, when I use data entry code to add to another worksheet, the input only shows the sequence of the list (not the text in the list). How can I change these sequences to the text in the list?

In addition, I already named the column in master data worksheet. How can I add the information to the master data worksheet by referring to column name instead of the number of column?

Here is my vba code

'Add information in data form
   Application.ScreenUpdating = False
   
   Dim NextRow As Long, Lastrow As Long
   
   Lastrow = Sheets("CustomerMaster").Range("C" & Rows.Count).End(xlUp).Row
   
   NextRow = Lastrow + 1
   
   'If formValidation = True Then


        Sheets("CustomerMaster").Cells(NextRow, 1) = Sheets("Customer Data Entry").TextID
        Sheets("CustomerMaster").Cells(NextRow, 2) = Sheets("Customer Data Entry").TextCompany
        Sheets("CustomerMaster").Cells(NextRow, 3) = Sheets("Customer Data Entry").DropDowns("Drop Down 8")
        Sheets("CustomerMaster").Cells(NextRow, 4) = Sheets("Customer Data Entry").TextRevenue
        Sheets("CustomerMaster").Cells(NextRow, 5) = Sheets("Customer Data Entry").TextAddress
        Sheets("CustomerMaster").Cells(NextRow, 6) = Sheets("Customer Data Entry").DropDowns("Drop Down 11")
        Sheets("CustomerMaster").Cells(NextRow, 7) = Sheets("Customer Data Entry").TextInitialCust
        Sheets("CustomerMaster").Cells(NextRow, 8) = Sheets("Customer Data Entry").TextSource
        Sheets("CustomerMaster").Cells(NextRow, 9) = Sheets("Customer Data Entry").TextEntered
        Sheets("CustomerMaster").Cells(NextRow, 10) = Sheets("Customer Data Entry").DropDowns("Drop Down 21")
        Sheets("CustomerMaster").Cells(NextRow, 11) = Sheets("Customer Data Entry").TextRemarkCust
0

There are 0 best solutions below