How to cross-multiply text data in excel??

  • Thread starter Thread starter sang
  • Start date Start date
S

sang

I need to cross-multiply following dat:

COLUMNS:
A........................B

ABC...................PQR
BBC...................LMN
KBC...................KKP

The result should be:

COLUMNS:
A........................B

ABC...................PQR
ABC...................LMN
ABC...................KKP
BBC...................PQR
BBC...................LMN
BBC...................KKP
KBC...................PQR
KBC...................LMN
KBC...................KKP

plz help
 
Hi,

Right click your sheet tab, view code and paste this in and run it.

Sub swapem()
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Range("A1:A" & lastrow).Copy
Range("A" & 65536 - lastrow).PasteSpecial
Range("B1:B" & lastrow).Copy
Range("A1").PasteSpecial
Range("A" & 65536 - lastrow & ":A65536").Copy
Range("B1").PasteSpecial
Range("A" & 65536 - lastrow & ":A65536").ClearContents
End Sub

Mike
 

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

Similar Threads

data splitting 1
collapse rows into one 2
Formula help 7
copy no match 2
How do I filter out lines in a range? 9
data splitting 4
Data Alignment in columns 2
Look-up and Merge 2

Back
Top