transposing and parsing cells

  • Thread starter Thread starter James
  • Start date Start date
J

James

Here is my question: I have two cells, side by side on the same row.
One has an amount in it, the other has a list of names, comma
delimited. I need to transpose the names so that there is one row per
name, with the amount next to it (same amount for each row). How can I
start this going? Thanks much.
 
Try this (untested)

sub tspose()

dim vAmt, arrNames, rDest as range,x as integer

vAmt=activesheet.range("A1").value
arrNames=split(activesheet.range("B1").value,",")

set rDest=activesheet.range("A3")

for x=lbound(arrNames) to ubound(arrNames)
rDest.value=vAmt
rDest.offset(0,1).value=arrNames(x)
set rDest=rDest.offset(1,0)
next x

end sub


Tim.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top