Excel VBA Split Question

Jim _B28 1 Reputation point
2022-08-27T19:32:19.37+00:00

Split Function Question
I have a problem I am hoping you can help me solve. I have created an Excel spreadsheet for my DVD movie collection. I have created a User Form that requests where the DVD movie is located as Room Location, Case Location and Shelf Location. Then I concatenated the 3 into one cell using a “ / “ as a delimiter.
When I am in Edit Mode I place the record back into the User Form TextBoxes. Using a sub file that I call from the Edit Mode sub I get the Excel split function to separate the single string into the 3 strings. My problem is so far all I can do is write the strings out as a MsgBox. I don’t know how to get the separate strings back into their appropriate TextBoxes in the User Form.
Here is the Sub I am using:
Sub EasySplit()
Dim s as String
Dim arr() as String
Dim v as Variant
s = Range (“L8”).Value (this is the cell with my concatenated string in first record that the Edit Mode retrieves)
arr = Split(s, “ / “)
For Each v in arr
MsgBox v
Next v
I need to get these strings into their TextBoxes in the User Form:
Set CurrentIdCell = JBData.Range("B7").Offset(CurrentRecordId, 0)
Call EasySplit
RoomLocation = CurrentIdCell.Offset(0, 10).Value
CaseLocation = CurrentIdCell.Offset(0, 11).Value
ShelfLocation = CurrentIdCell.Offset(0, 12).Value
I hope I’ve given you enough information to help. I know I could just put the 3 into one string, but I’d like to see if someone could get this to work for me.
Thank you in advance for your assistance.

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,583 questions
0 comments No comments
{count} votes