Fredric Andersson
New Member
- Joined
- Sep 30, 2021
- Messages
- 10
- Office Version
- 365
- Platform
- Windows
Hi guys,
Decription of the problem:
I have a running code that works, but it will be like 200 miles long.
following code below works but i want to shorten it.
Dim n1 As Long, n2 As Long, n3 As Long, n4 As Long, n5 As Long, n6 As Long
n1 = Worksheets("riskanalys").Range("a2").Text
riskanalys_dashboard.n1 = n1
n2 = Worksheets("riskanalys").Range("a3").Text
riskanalys_dashboard.n2 = n2
n3 = Worksheets("riskanalys").Range("a4").Text
riskanalys_dashboard.n3 = n3
n4 = Worksheets("riskanalys").Range("a5").Text
riskanalys_dashboard.n4 = n4
The problem is that i have 6 columns with data i want to place in label in userform.
the exemple i have above will go up to 30 in range. so its a lof of single code.
Explaning everything:
N1 - n4 is a label in a userform.
Worksheet Riskanalys RAnge A1-a4
what i want and hope you guys can help me with is a code that help me place values from Range A:A to label "n"
Best regards
Fredric
Decription of the problem:
I have a running code that works, but it will be like 200 miles long.
following code below works but i want to shorten it.
Dim n1 As Long, n2 As Long, n3 As Long, n4 As Long, n5 As Long, n6 As Long
n1 = Worksheets("riskanalys").Range("a2").Text
riskanalys_dashboard.n1 = n1
n2 = Worksheets("riskanalys").Range("a3").Text
riskanalys_dashboard.n2 = n2
n3 = Worksheets("riskanalys").Range("a4").Text
riskanalys_dashboard.n3 = n3
n4 = Worksheets("riskanalys").Range("a5").Text
riskanalys_dashboard.n4 = n4
The problem is that i have 6 columns with data i want to place in label in userform.
the exemple i have above will go up to 30 in range. so its a lof of single code.
Explaning everything:
N1 - n4 is a label in a userform.
Worksheet Riskanalys RAnge A1-a4
what i want and hope you guys can help me with is a code that help me place values from Range A:A to label "n"
Best regards
Fredric