Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sum - Offset - Address problem. | Excel Worksheet Functions | |||
Offset to different worksheet problem | Excel Worksheet Functions | |||
VLOOKUP/OFFSET Problem | Excel Discussion (Misc queries) | |||
Offset Problem | New Users to Excel | |||
Sum Activecell Offset Problem | Excel Worksheet Functions |