merge ranges

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

i have a function as follows

Function (a, inputX as Range, inputY as Range)

I need to sort both ranges in asc order by inputX.
I am thinking of using CurrentRegion.Sort command. To use this I need to
merge these ranges into one range so that my inputY range would get sorted .
How would i do this?

Thanks a lot,
 
The union function is used ot merge ranges. Try something like this...

Function (a, inputX as Range, inputY as Range)
dim rngMerged as range

set rngMerged = Union(inputX, inputY)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top