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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro - transpose - audit 1

Status
Not open for further replies.

coltaalex

Technical User
Jul 2, 2010
61
US
Hello experts in VBA excel.

I have a excel sheet, with which my coworker collects data from the different audits, he is collecting it on diagonal form (upper left to bottom right), because the columns and rows content is changing all the time ( data collection)

So i would like to create a macro which is transposing the row information into column, and from diagonal to make a column.
how can i attach an excel sheet here, to show you what i mean ?
 
Does a copy->Paste Special/Transpose not do what you need?
 
No, because i have to create a column from the diagonal rows
 
To make a column out of the diagonals, and assuming that "usedrange" will work for you (sometimes it is undone by ill-formed data):
Code:
set r = sheets(1).usedrange 'assuming sheet1
numcols=r.columns.count
for i = 1 to numcols step 1
    sheets(1).cells(i,numcols+1)=sheets(1).cells(i,i)
next

_________________
Bob Rashkin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top