I get raw data from querys into Excel, and when preforming VLOOKUP's sometimes I have to count or calculate by hand what column I am going to refer to.
I want a calculator were I type in userform textbox ex: "M", and the other textbox will show the correct column number for "M" (13).
My userform looks like this:
I have come up with something like the code below, I dim every letter as an integer and when that is typed in to the textbox it will add each others values.
I don't know how to code the CommandButton1_click "Räkna".
Private Sub CommandButton1_Click()
'how do i transform letters into numbers here?
End Sub
Sub raknare()
Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim d As Integer
Dim e As Integer
Dim f As Integer
Dim g As Integer
Dim h As Integer
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim l As Integer
Dim m As Integer
Dim n As Integer
Dim o As Integer
Dim p As Integer
Dim q As Integer
Dim r As Integer
Dim s As Integer
Dim t As Integer
Dim u As Integer
Dim v As Integer
Dim w As Integer
Dim x As Integer
Dim y As Integer
Dim z As Integer
Set a = 1
Set b = 2
Set c = 3
Set d = 4
Set e = 5
Set f = 6
Set g = 7
Set h = 8
Set i = 9
Set j = 10
Set k = 11
Set l = 12
Set m = 13
Set n = 14
Set o = 15
Set p = 16
Set q = 17
Set r = 18
Set s = 19
Set t = 20
Set u = 21
Set v = 22
Set w = 23
Set x = 24
Set y = 25
Set z = 26
End Sub