PNG32 PNG32 PNG32 PNG32
PNG32
Forum Excel, VBA, VSTO, Exceltips, Excelhj�lp PNG32 drivs av Excelspecialisten    Logga in     English
PNG32
PNG32 PNG32
PNG32

Logga in

PNG32

Du är inte inloggad. Logga in eller registrera dig för att skriva inlägg eller svara på inlägg.

För frågor om forumet, kontakta oss på webmaster@excelforum.se

PNG32 PNG32
PNG32 PNG32
PNG32

Excelforum

PNG32

 
ForumForumDiskussionerDiskussionerVBAVBAsöker ett enklare sätt och en bättre programering av det jag vill göra.söker ett enklare sätt och en bättre programering av det jag vill göra.
Föregående Föregående
 
Nästa Nästa
Nytt inlägg
 2010-06-14 12:22
 

Går det att göra den här koden på ett enklare sätt?

Private Sub spol1_Change()

spolt1.Caption = spol1.Value

If spol1.Value = 0 Then
spolt1.Caption = "N/A"
End If

If spol1.Value = 1 Then
spolt1.Caption = "0,1"
End If

If spol1.Value = 2 Then
spolt1.Caption = "0,2"
End If

If spol1.Value = 3 Then
spolt1.Caption = "0,3"
End If

If spol1.Value = 4 Then
spolt1.Caption = "0,4"
End If

If spol1.Value = 5 Then
spolt1.Caption = "0,5"
End If

If spol1.Value = 6 Then
spolt1.Caption = "0,6"
End If

If spol1.Value = 7 Then
spolt1.Caption = "0,7"
End If

If spol1.Value = 8 Then
spolt1.Caption = "0,8"
End If

If spol1.Value = 9 Then
spolt1.Caption = "0,9"
End If

If spol1.Value = 10 Then
spolt1.Caption = "1,0"
End If

If spol1.Value = 11 Then
spolt1.Caption = "1,1"
End If

If spol1.Value = 12 Then
spolt1.Caption = "1,2"
End If

If spol1.Value = 13 Then
spolt1.Caption = "1,3"
End If

If spol1.Value = 14 Then
spolt1.Caption = "1,4"
End If

If spol1.Value = 15 Then
spolt1.Caption = "1,5"
End If

If spol1.Value = 16 Then
spolt1.Caption = "1,6"
End If

If spol1.Value = 17 Then
spolt1.Caption = "1,7"
End If

If spol1.Value = 18 Then
spolt1.Caption = "1,8"
End If

If spol1.Value = 19 Then
spolt1.Caption = "1,9"
End If

If spol1.Value = 20 Then
spolt1.Caption = "2,0"
End If

Tack för hjälpen.

Nytt inlägg
 2010-06-14 13:33
 


spolt1.Caption = spol1.Value

If spol1.Value = 0 Then
          spolt1.Caption = "N/A"
Else
          spolt1.Caption = Cstr(spol1.Value/10)
End If

... borde funka.

Nytt inlägg
 2010-06-14 14:31
 

Tack så hemskt mycket fungerar kanon!!!

Föregående Föregående
 
Nästa Nästa
ForumForumDiskussionerDiskussionerVBAVBAsöker ett enklare sätt och en bättre programering av det jag vill göra.söker ett enklare sätt och en bättre programering av det jag vill göra.

PNG32 PNG32
Excelforum drivs av Excelspecialisten som bedriver utbildning i Excel och VBA, tillhandahåller support och hjälp med Excel, utvecklar program i Excel. Är ni i behov av en konsult inom Excel, VBA eller VSTO, eller söker en excelkurs, kontakta oss.
Copyright 2013 ExcelSpecialisten XLS AB   Användarvillkor  Personliga uppgifter