Hi. I've come up with VBA code that works fine, but is long, and probably can be compressed into something shorter or more tidy.
Is there a way to substitute these multiple statements with something like arrays or anything else?
I'm quite new to VBA (only programming I'm doing) - tried few tutorials about arrays, but for now it is beyond my understanding.
Thanks in advance.
My code is:
Is there a way to substitute these multiple statements with something like arrays or anything else?
I'm quite new to VBA (only programming I'm doing) - tried few tutorials about arrays, but for now it is beyond my understanding.
Thanks in advance.
My code is:
Code:
If proponowano = "TAK" Then
If kpu = "a" Then stawka_u = 70
If kpu = "b" Then stawka_u = 75
If kpu = "c" Then stawka_u = 90
If kpu = "m" Then stawka_u = 140
If kpu = "d" Then stawka_u = 130
If kpu = "van" Then stawka_u = 130
If kpu = "p" Then stawka_u = 260
If kpu = "e" Then stawka_u = 255
If kpu = "suv" Then stawka_u = 500
If kpu = "f" Then stawka_u = 500
If kpu = "g" Then stawka_u = 649
If kpu = "h" Then stawka_u = 800
If kpu = "dsuv" Then stawka_u = 0
If kpu = "inna" Then stawka_u = 0
If kpw = "a" Then stawka_w = 70
If kpw = "b" Then stawka_w = 75
If kpw = "c" Then stawka_w = 90
If kpw = "m" Then stawka_w = 140
If kpw = "d" Then stawka_w = 130
If kpw = "van" Then stawka_w = 130
If kpw = "p" Then stawka_w = 260
If kpw = "e" Then stawka_w = 255
If kpw = "suv" Then stawka_w = 500
If kpw = "f" Then stawka_w = 500
If kpw = "g" Then stawka_w = 649
If kpw = "h" Then stawka_w = 800
If kpw = "dsuv" Then stawka_w = 0
If kpw = "inna" Then stawka_w = 0
End If