Greetings All ~
I absolutely cannot believe I'm here asking how to do this but Google has no clue
The setup is simple - I'm looping through a listbox and placing each selected item in one cell on an excel sheet.
I'm using Chr(10) to stack them atop one another. What I'm trying to do is simply remove the trailing Chr(10) character once all the values are entered into the cell
In the immediate window ?Rng is showing the cell value but for some reason the Trim is not working
I have tried If statements (which I don't think would not be necessary here because the trailing Chr(10) will always be present
I have tried RTrim; Right; Left; LTrim and WouldYouPleaseForLoveOfGodWorkTrim et al.
And here I am...
As Always Thank You for any assistance...
RT 91
I absolutely cannot believe I'm here asking how to do this but Google has no clue
The setup is simple - I'm looping through a listbox and placing each selected item in one cell on an excel sheet.
I'm using Chr(10) to stack them atop one another. What I'm trying to do is simply remove the trailing Chr(10) character once all the values are entered into the cell
Code:
Dim Rng As Range
Dim Str As String
Set Rng = ThisWorkbook.Sheets("Checklist").Range("G2")
Str = Rng.Value
For p = 0 to UserForm.LstSusRsns.ListCount -1
If UserForm.LstSusRsns.Selected(p) = True Then
ThisWorkbook.Sheets("Checklist").Range ("G2") _
= ThisWorkbook.Sheets("Checklist").Range ("G2") _
& UserForm.LstSusRsns.Selected.List(p, 0) & Chr(10)
'This is one of probably 10-12 trys and my latest failure which brought me here
Rng.Value = Trim(Rng.Value)
In the immediate window ?Rng is showing the cell value but for some reason the Trim is not working
I have tried If statements (which I don't think would not be necessary here because the trailing Chr(10) will always be present
I have tried RTrim; Right; Left; LTrim and WouldYouPleaseForLoveOfGodWorkTrim et al.
And here I am...
As Always Thank You for any assistance...
RT 91