#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default Offset VBA Problem

I am writting code to clear an area of a spread sheet. I have the
upper left hand cell selected, but I need to be able to offset from
this point and go down 6 rows and 6 columns. So instead of just
selecting A1 it woudl select A1:F7.

Thanks in advance,
Jay

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default Offset VBA Problem

One way:

Range("A1").Resize(7, 6).ClearContents

Note that you almost never need to select a range - working directly
with the range object makes your code smaller, faster, and IMO, easier
to maintain...

In article . com,
jlclyde wrote:

I am writting code to clear an area of a spread sheet. I have the
upper left hand cell selected, but I need to be able to offset from
this point and go down 6 rows and 6 columns. So instead of just
selecting A1 it woudl select A1:F7.

Thanks in advance,
Jay

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default Offset VBA Problem

On Sep 18, 9:53 am, JE McGimpsey wrote:
One way:

Range("A1").Resize(7, 6).ClearContents

Note that you almost never need to select a range - working directly
with the range object makes your code smaller, faster, and IMO, easier
to maintain...

In article . com,



jlclyde wrote:
I am writting code to clear an area of a spread sheet. I have the
upper left hand cell selected, but I need to be able to offset from
this point and go down 6 rows and 6 columns. So instead of just
selecting A1 it woudl select A1:F7.


Thanks in advance,
Jay- Hide quoted text -


- Show quoted text -


Thank you for the help. I will keep that in mind when writting future
code.
Jay

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 611
Default Offset VBA Problem

Jay,

Range(Selection, Cells(Selection.Row + 6, Selection.Column + 6)).Select
Or more easily
Selection.Resize(6, 6).Select

You might want to put questions like these in microsoft.public.excel.programming

--
Regards from Virginia Beach,

Earl Kiosterud
www.smokeylake.com

Note: Top-posting has been the norm here.
Some folks prefer bottom-posting.
But if you bottom-post to a reply that's
already top-posted, the thread gets messy.
When in Rome...
-----------------------------------------------------------------------
"jlclyde" wrote in message
ups.com...
I am writting code to clear an area of a spread sheet. I have the
upper left hand cell selected, but I need to be able to offset from
this point and go down 6 rows and 6 columns. So instead of just
selecting A1 it woudl select A1:F7.

Thanks in advance,
Jay



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
Sum - Offset - Address problem. DaveO Excel Worksheet Functions 1 February 22nd 07 03:59 PM
Offset to different worksheet problem edwardpestian Excel Worksheet Functions 3 May 5th 06 03:46 PM
VLOOKUP/OFFSET Problem XavierXXX Excel Discussion (Misc queries) 1 November 18th 05 05:34 PM
Offset Problem morrida3 New Users to Excel 1 September 16th 05 08:02 PM
Sum Activecell Offset Problem George Andrews Excel Worksheet Functions 3 May 22nd 05 12:12 AM


All times are GMT +1. The time now is 12:30 AM.

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

About Us

"It's about Microsoft Excel"