Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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"
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 599
Default 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"



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 171
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Define Name range Gotroots Excel Discussion (Misc queries) 10 December 19th 09 11:30 AM
Define a range jlclyde Excel Discussion (Misc queries) 2 April 17th 08 08:26 PM
Define a range based on another named range Basil Excel Worksheet Functions 2 February 21st 05 01:47 PM
Define Range with an offset GregR Excel Discussion (Misc queries) 9 December 21st 04 07:22 AM
Re : MS Excel’s Offset Property TKT-Tang Excel Programming 2 July 10th 03 03:57 AM


All times are GMT +1. The time now is 03:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"