Forum Discussion
Create text string from input
- Dec 12, 2018
Are you familiar with User Defined Functions? I believe the function below would do what you are after.
Function PeriodString(PeriodStart As Integer, PeriodEnd As Integer, Factor As String)
Dim i As Integer
For i = PeriodStart To PeriodEnd
If i = PeriodEnd Then
PeriodString = PeriodString & i & "|" & Factor
ElsePeriodString = PeriodString & i & "|" & Factor & ";"
End If
Next i
End Function
Are you familiar with User Defined Functions? I believe the function below would do what you are after.
Function PeriodString(PeriodStart As Integer, PeriodEnd As Integer, Factor As String)
Dim i As Integer
For i = PeriodStart To PeriodEnd
If i = PeriodEnd Then
PeriodString = PeriodString & i & "|" & Factor
Else
PeriodString = PeriodString & i & "|" & Factor & ";"
End If
Next i
End Function
Thanks, this works great. If you do have a formula it would be even better.
- JWR1138Dec 12, 2018Iron ContributorAlas, I do not, I tend to jump right to a VBA solution, usually a lot easier to read/work with for me than a bunch of nested built in functions. Sorry.