PDA

View Full Version : [SOLVED] Placing comma separated values into the corresponding cell



Mati44
04-11-2018, 10:46 AM
I have comma separated values like (1,2,3 or 10,50,60,70 etc..) in Column A, and in Column B, in the corresponding cells there are cell locations like C10, C15,C40,C100 etc..
I need a way to place the values in Column A into the corresponding Cell location in Column B. Column A is the source of Data (comma separated values), and Column B is the location of the data. Column C is where the data will be placed. Column A and Column B have data without spaces, however there will be spaces ( empty cells) in Column C when all data is placed. There aren't enough data to fill all the cells in Column C. Is there way to do this with a formula or VBA? please. Thanks. It will look something like this:




A
B
C


1,2,3
C2



4,5,6
C5
1,2,3


7,8,9,10
C7



11,12,13
C9



.....etc
..etc
4,5,6









7,8,9,10









11,12,13

Paul_Hossler
04-11-2018, 11:25 AM
VBA, and no error checking



Option Explicit

Sub PutData()
Dim r As Long, n As Long

With ActiveSheet
n = .Cells(1, 1).CurrentRegion.Rows.Count
For r = 1 To n
Range(.Cells(r, 2).Value).Value = .Cells(r, 1).Value
Next r
End With
End Sub

Mati44
04-11-2018, 11:37 AM
Thanks a lot, Paul! This works perfectly. I didn't have any issues. Have a great day!