View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Pete[_22_] Pete[_22_] is offline
external usenet poster
 
Posts: 31
Default Selecting multiple ranges using 'Cells' notation

Hi to all in the group
Is it possible to 'set' the range of a variable (defined as Range) to a
multi-range using Cells notation?

This works:
Set RngWeek = Range("E8:K8,U8:AA8")

The macro will I set a row to be the active row
Say it is row 8
Can I set the range using the a command similar to the one below
This doesn't work:
Set RngWeek = Range(Cells(ActiveCell.Row, 5), Cells(ActiveCell.Row, 11),
Cells(ActiveCell.Row, 21), Cells(ActiveCell.Row, 27))

Peter Bircher
Kwazulu-Natal, SA