Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
replace:
Set source = .Range(multirange) with Set source = multirange Chad wrote: Tried a new approach from the help menu, but it failed also Set r1 = Range(Cells(1, 1), Cells(1, 5)) Set r2 = Range(Cells(17, 1), Cells(19, 5)) Set multirange = Union(r1, r2) multirange.Select 'This worked With Workbooks(ShortRawMonFileName).Sheets("Sheet1") Set source = .Range(multirange) 'This didn't End With "Dave Peterson" wrote in message ... If shortrawmonfilename isn't the active workbook or if sheet1 is not the activesheet, then your code will fail. I'd use: with Workbooks(ShortRawMonFileName).Sheets("Sheet1") set source = .Range(.Cells(1, 1), .Cells(16, 5)) end with or just: Set source = Workbooks(ShortRawMonFileName).Sheets("Sheet1").Ra nge("A1:E16") Chad wrote: Hi All, I am trying to use row&col in a range. Code is as follows. I get the errow application-defined or object-defined error ShortRawMonFileName is correct and "Sheet1" is correct Set source = Workbooks(ShortRawMonFileName).Sheets("Sheet1").Ra nge(ActiveSheet.Cells(1, 1), ActiveSheet.Cells(16, 5)) I also tried Set source = Workbooks(ShortRawMonFileName).Sheets("Sheet1").Ra nge(Cells(1, 1), Cells(16, 5)) Thanks Chad -- Dave Peterson -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Range as cell numbers | Excel Programming | |||
sum a range of numbers entered into a cell | New Users to Excel | |||
Range of numbers in a single cell | Excel Discussion (Misc queries) | |||
occurance of numbers in cell range | Excel Worksheet Functions | |||
Sum the first 10 numbers in a 26 cell range | Excel Programming |