Hi,
I've been visiting this forum through Google search to help me with Excel questions for a while now, and it seems like the help is consistently timely and effective for other users' specific questions, so I went ahead and registered to post a question of my own.
I am trying to get a macro to run in excel that takes a simple text to columns command in one line of data and runs the command on a loop through however many rows of data there happen to be. I thought getting this to work would be more straightforward, but I've been trying unsuccessfully for a while now, which led me to seek help from the experts on this board.
I've attached two screenshots - one with what I've got now (Before.jpg) and what I'd like to have after the macro runs (After.jpg). The code below is what I used to get the first text to column breakout, which I can hopefully run on a loop to breakout anything in the DEPT column that contains a "/". It can ignore the rows that only have one department to begin with.
Selection.TextToColumns Destination:=Range("K2"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="/", FieldInfo:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True
Eventually I'll want to create another macro that transposes the breakout text back into the DEPT column and populates it with the corresponding data, but I figure I'll take things one step at a time.
I think I've provided enough info for anyone who wants to assist, but if not let me know what else I can do. Thanks in advance for the help!
Bookmarks