Working outside Excel to transpose data columns

I have had a lot of help in the past from this site and I think I have asked about this before issue. As a result I have been able to speed up work with excel. I think I am missing some the script below is designed to reorganize data in a worksheet the source for which originated on the web.

The variable AllData collects the data on a worksheet. The repeat block basically moves the columns. I feel That I may have asked this before but cannot find the answer.

Having transposed the columns of data I want to paste it back into the same location on the worksheet
This is the script with some of my failed attempts

tell application "Microsoft Excel"
	set AllData to used range of active sheet
	set Alldata1 to string value of AllData
	set AllDataRev to Alldata1
	set {LastRow} to {count rows of AllData}	
	repeat with Sname from LastRow to 1 by -1
		set item 1 of item Sname of AllDatarev to item 1 of item Sname of Alldata1
		set item 2 of item Sname of AllDatarev to item 5 of item Sname of Alldata1 --
		set item 3 of item Sname of AllDatarev to item 2 of item Sname of Alldata1 --
		set item 4 of item Sname of AllDatarev to item 3 of item Sname of Alldata1 --
		set item 5 of item Sname of AllDatarev to item 4 of item Sname of Alldata1 --
		set item 6 of item Sname of AllDatarev to item 8 of item Sname of Alldata1 --
		set item 7 of item Sname of AllDatarev to 0
		set item 8 of item Sname of AllDatarev to item 8 of item Sname of Alldata1 --
		log item Sname of AllDatarev
	end repeat
	--select range ("a24")
	--copy range range AllDataRev
	--set used range of active sheet to AllDataRev
	--set test to value of AllDataRev
	--paste special on worksheet active sheet destination range "a24"
	--paste special AllDataRev what paste values
end tell

Sorry but finally worked it out my apologies

	set value of (used range of active sheet) to Alldatarev
1 Like