![]() |
offset property to define range
I have an object variable for a range on the spreadsheet.
What is the easiest way to select a rectangular range on the spreadsheet using the offset property (or something similar). I have this so far: Dim testRng As Range Set testRng = Worksheets("Sheet1").Range("A1:D20") testRng.Value = 9 testRng.Cells(4 to 6,1 to 3).ClearContents 'error "to" |
offset property to define range
Art
testRng.Cells(1).Offset(3,0).Resize(3,3).ClearCont ents -- Dick Kusleika MVP - Excel www.dicks-clicks.com Post all replies to the newsgroup. "Art" wrote in message ... I have an object variable for a range on the spreadsheet. What is the easiest way to select a rectangular range on the spreadsheet using the offset property (or something similar). I have this so far: Dim testRng As Range Set testRng = Worksheets("Sheet1").Range("A1:D20") testRng.Value = 9 testRng.Cells(4 to 6,1 to 3).ClearContents 'error "to" |
offset property to define range
testRng(4, 1).Resize(3, 3).ClearContents is probably easier.
Alan Beban Dick Kusleika wrote: Art testRng.Cells(1).Offset(3,0).Resize(3,3).ClearCont ents |
All times are GMT +1. The time now is 11:02 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com