Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making Matrix from the available data

Status
Not open for further replies.

SJSUHSG

Technical User
Apr 5, 2005
3
US
How to convert following data to a matrix as shown below:

Data:

a a b c d e
b a b c d e
c a b c d e
d a b c d e
e a b c d e

to Matrix below:

a b c d e
b a c d e
c b a d e
d c b a e
e d c b a

 
heres one way manipulating the string

Dim x As Byte, mystr As String
mystr = "adcde"
For x = 1 To 5
Debug.Print mystr
mystr = Mid(mystr, x + 1, 1) & Left(mystr, x) & Right(mystr, Abs((Len(mystr) - (x + 1))))
Next

could do something similar using replace function and instr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top