View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Select multiple ranges using cells property

Try the below...


intRows = 10

Range(Range(Cells(5, 4), Cells(intRows, 5)).Address & "," & _
Range(Cells(5, 6), Cells(intRows, 7)).Address).BorderAround Weight:=xlThin

--
Jacob


"Spike" wrote:

I will be very grateful for the code to select two ranges at the same time.
I am formatting these ranges with borders etc and rather than do each one in
turn would like to do them at the same time. The two ranges are as below.

Range(Cells(5, 4), Cells(intRows, 5))

Range(Cells(5, 6), Cells(intRows, 7))

Everything I have tried selects the whole area and not separately, using D5
etc is simple but as this is dynamic I need to use the Cells property

many thanks
--
with kind regards

Spike