Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a question regarding refering to ranges. Below is some sample
(and simple) code to illustrate my question. I prefer to use R1C1 notation and the cells property. But I have to use the A1 notation when I set the range "r" in the code below. Why can't I replace that line with: Set r = y.Range(cells(1,1),cells(3,3)) This line returns the " Method 'Range' or object '_Worksheet' failed " error. Thanks for the help, John Sub junk() Dim xyz As Workbook Dim x As Worksheet Dim y As Worksheet Dim z As Worksheet Dim r As Range Set xyz = ActiveWorkbook abc.Activate ' Set x = xyz.Worksheets("X") Set y = xyz.Worksheets("Y") Set z = xyz.Worksheets("Z") Set r = y.Range("A1:C3") r.Font.Bold = True End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
What does it mean define ranges in Excell for import | New Users to Excel | |||
How select/define cells with FIND method (maybe together with SpecialCells) | Excel Programming | |||
Automatically define series of named ranges | Excel Programming | |||
Does RangeFromPoint Method return ranges? | Excel Programming | |||
union method for non-adjacent ranges | Excel Programming |