Yugal Jindle Yugal Jindle - 2 months ago 10
Vb.net Question

How do I reverse a list in VB.NET?

I have:

clientWB.Sheets(getClientSheetNames("currMonth").ToArray).Copy(After:=devWB.Sheets(1))


Function: getClientSheetNames("currMonth") returns a list of String.

I want to select the sheets in reverse order, so I did:

clientWB.Sheets(getClientSheetNames("currMonth").Reverse().ToArray).Copy(After:=devWB.Sheets(1))


But it gives an error:


getClientSheetNames("currMonth").Reverse() => Expression does not produce a value


What am I doing wrong? How should I correct it?

Answer

Have you tried a switcheroo on your calls?

getClientSheetNames("currMonth").ToArray.Reverse()
Comments