Reverse function in cells
Posted by Nick on October 28, 2000 5:33 AM
I have made a macro function and I am trying to use this function on cells in a spreadsheet but I cannot figure it out. My code for the reverse function is :
-Start of code-
Function Reverse (text as string) as string
For N = len(text) to 1 step - 1
reverse = reverse & mid(text,n,1)
Next N
End function
-End of code-
Run it in immeadiate mode to test if you wish.
So far I have the following but something is missing:
-Strat of code-
Function rangereverse(sheete, cellz)
Worksheets(sheete).Activate
Worksheets(sheete).Range(cellz).Function = "reverse"
End Function
-End of code-
I need to use a the following command:
call rangereverse ("Sheet1", "A1:C3")
or any cell range.
Can you help me get this to work using another sub procedure to reverse cells, with any range of cells?