![]() |
#11
|
||||
|
||||
![]()
You probably need something like the following, but if there are lots of these values as seems to be the case you would be better putting the codes and their values in an Excel worksheet and reading them from the worksheet.
Code:
Private Sub CommandButton2_Click() Dim sVia As String Dim lPK As String sVia = ComboVia.Text lPK = textPK.Value Select Case sVia Case Is = "A-68" If lPK > 81 And lPK < 85 Then Rellenar "termino", "Castejon" Rellenar "partido", "Tudela" End If If lPK > 84 And lPK < 99 Then Rellenar "termino", "Corella" Rellenar "partido", "Estella" End If If lPK > 98 And lPK < 113 Then Rellenar "termino", "Fontellas" Rellenar "partido", "Tafalla" End If Case Is = "NA-3010" If lPK > 20 And lPK < 25 Then Rellenar "termino", "Cortes" Rellenar "partido", "Tudela" End If If lPK > 24 And lPK < 35 Then Rellenar "termino", "Ribaforada" Rellenar "partido", "Tafalla" End If If lPK > 34 And lPK < 44 Then Rellenar "termino", "Novillas" Rellenar "partido", "Estella" End If End Select lbl_Exit: Exit Sub End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Saving a word doc as a pdf with bookmarks | MimiCush | Word | 10 | 03-26-2018 01:51 PM |
![]() |
adilprodigy | Word VBA | 1 | 10-11-2017 01:31 PM |
![]() |
PeterPlys | Word VBA | 13 | 01-14-2015 06:41 AM |
![]() |
dnc | Word VBA | 4 | 05-10-2013 04:58 PM |
word 2007 bookmarks | Dawn | Word | 0 | 07-14-2009 01:00 PM |