Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Die_Another_Day wrote:
Because Cells, unless otherwise told, references cells on the ActiveSheet. So you are tell it in effect: Set fromRange = Worksheets("AAdata").Range(ActiveSheet.Cells(2, 4), _ ActiveSheet.Cells(2, 11)) What you really want to tell it is this: Set fromRange = Worksheets("AAdata").Range(Worksheets("AAdata").Ce lls(2, 4), _ Worksheets("AAdata").Cells(2, 11)) Which could be shortened to this: With Sheets("AAdata") Set fromRange = .Range(.Cells(2,4),.Cells(2,11)) End With Or shortened further to Set rng = Sheets("AAdata").Range("A1") Set fromRange = Range(rng(2, 4), rng(2, 11)) Alan Beban |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Runtime Error - Subscript out of range despite On Error statement | Excel Programming | |||
Subscript out of range error - save copy error | Excel Programming | |||
Subscript out of range error - save copy error | Excel Programming | |||
Range.Select error and screen maximizing error in Workbook_Open() | Excel Programming | |||
Range.Select error and screen maximizing error in Workbook_Open() | Excel Programming |