Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
I have 4 variables: hpe1_st, hpe2_st, hpl1_st, hpl2_st.
I am looking for a vba solution to:
1) of the four, which one has the lowest value
2) return the variable name (eg hpe1_st, hpe2_st etc.) as another string variable (rtn_str) value. Ideally, I would just like to return the leading 4 characters)
Example
hpe1_st = 5
hpe2_st = 7
hpl1_st = 1
hpl2_st = 3
rtn_str = hpl1
Should multiple variables hold the samr value, it's ok to return the any of the matching variable.
I am looking for a vba solution to:
1) of the four, which one has the lowest value
2) return the variable name (eg hpe1_st, hpe2_st etc.) as another string variable (rtn_str) value. Ideally, I would just like to return the leading 4 characters)
Example
hpe1_st = 5
hpe2_st = 7
hpl1_st = 1
hpl2_st = 3
rtn_str = hpl1
Should multiple variables hold the samr value, it's ok to return the any of the matching variable.