Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I am in any cells how do I select same cell plus right cell plus cell thee
spots to the right... my current cell location might vary. Thanks, |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ActiveCell.Resize(1, 5).Select
Note: most times there is no need to select a range in order to work on it. ActiveCell.Resize(1, 5).Interior.ColorIndex = 3 Gord Dibben MS Excel MVP On Sat, 12 Sep 2009 17:50:01 -0700, Alberto Ast wrote: If I am in any cells how do I select same cell plus right cell plus cell thee spots to the right... my current cell location might vary. Thanks, |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for your input... but what if I need to select two separate ranges at
the same time.... Resize only pick up a continuous range. For instance I need to select cells on col A,B,F,G,J on a specific row "Gord Dibben" wrote: ActiveCell.Resize(1, 5).Select Note: most times there is no need to select a range in order to work on it. ActiveCell.Resize(1, 5).Interior.ColorIndex = 3 Gord Dibben MS Excel MVP On Sat, 12 Sep 2009 17:50:01 -0700, Alberto Ast wrote: If I am in any cells how do I select same cell plus right cell plus cell thee spots to the right... my current cell location might vary. Thanks, |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use Application.Union to combine several cells into a single Range
object: Dim RR As Range Dim RowNum As Long RowNum = ActiveCell.Row Set RR = Application.Union( _ Cells(RowNum, "A"), Cells(RowNum, "C"), Cells(RowNum, "E")) RR.Select Of course, all the cells must be on the same worksheet. Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2009 Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Sat, 12 Sep 2009 19:26:01 -0700, Alberto Ast wrote: Thanks for your input... but what if I need to select two separate ranges at the same time.... Resize only pick up a continuous range. For instance I need to select cells on col A,B,F,G,J on a specific row "Gord Dibben" wrote: ActiveCell.Resize(1, 5).Select Note: most times there is no need to select a range in order to work on it. ActiveCell.Resize(1, 5).Interior.ColorIndex = 3 Gord Dibben MS Excel MVP On Sat, 12 Sep 2009 17:50:01 -0700, Alberto Ast wrote: If I am in any cells how do I select same cell plus right cell plus cell thee spots to the right... my current cell location might vary. Thanks, |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It works thanks
"Chip Pearson" wrote: Use Application.Union to combine several cells into a single Range object: Dim RR As Range Dim RowNum As Long RowNum = ActiveCell.Row Set RR = Application.Union( _ Cells(RowNum, "A"), Cells(RowNum, "C"), Cells(RowNum, "E")) RR.Select Of course, all the cells must be on the same worksheet. Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2009 Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Sat, 12 Sep 2009 19:26:01 -0700, Alberto Ast wrote: Thanks for your input... but what if I need to select two separate ranges at the same time.... Resize only pick up a continuous range. For instance I need to select cells on col A,B,F,G,J on a specific row "Gord Dibben" wrote: ActiveCell.Resize(1, 5).Select Note: most times there is no need to select a range in order to work on it. ActiveCell.Resize(1, 5).Interior.ColorIndex = 3 Gord Dibben MS Excel MVP On Sat, 12 Sep 2009 17:50:01 -0700, Alberto Ast wrote: If I am in any cells how do I select same cell plus right cell plus cell thee spots to the right... my current cell location might vary. Thanks, |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One more question... this is what I wrote
RowNum = ActiveCell.Row Set RR = Application.Union(Cells(RowNum, "A"), Cells(RowNum, "B"), _ Cells(RowNum, "D"), Cells(RowNum, "E"), Cells(RowNum, "F"), _ Cells(RowNum, "G"), Cells(RowNum, "I"), Cells(RowNum, "J")) RR.ClearContents But as you can see there are several consecutive cells... is there a way to simplify the comand? Thanks "Chip Pearson" wrote: Use Application.Union to combine several cells into a single Range object: Dim RR As Range Dim RowNum As Long RowNum = ActiveCell.Row Set RR = Application.Union( _ Cells(RowNum, "A"), Cells(RowNum, "C"), Cells(RowNum, "E")) RR.Select Of course, all the cells must be on the same worksheet. Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2009 Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Sat, 12 Sep 2009 19:26:01 -0700, Alberto Ast wrote: Thanks for your input... but what if I need to select two separate ranges at the same time.... Resize only pick up a continuous range. For instance I need to select cells on col A,B,F,G,J on a specific row "Gord Dibben" wrote: ActiveCell.Resize(1, 5).Select Note: most times there is no need to select a range in order to work on it. ActiveCell.Resize(1, 5).Interior.ColorIndex = 3 Gord Dibben MS Excel MVP On Sat, 12 Sep 2009 17:50:01 -0700, Alberto Ast wrote: If I am in any cells how do I select same cell plus right cell plus cell thee spots to the right... my current cell location might vary. Thanks, |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This single line of code should do what your post code does...
Intersect(ActiveCell.EntireRow, Range("A:B,D:G,I:J")).ClearContents -- Rick (MVP - Excel) "Alberto Ast" wrote in message ... One more question... this is what I wrote RowNum = ActiveCell.Row Set RR = Application.Union(Cells(RowNum, "A"), Cells(RowNum, "B"), _ Cells(RowNum, "D"), Cells(RowNum, "E"), Cells(RowNum, "F"), _ Cells(RowNum, "G"), Cells(RowNum, "I"), Cells(RowNum, "J")) RR.ClearContents But as you can see there are several consecutive cells... is there a way to simplify the comand? Thanks "Chip Pearson" wrote: Use Application.Union to combine several cells into a single Range object: Dim RR As Range Dim RowNum As Long RowNum = ActiveCell.Row Set RR = Application.Union( _ Cells(RowNum, "A"), Cells(RowNum, "C"), Cells(RowNum, "E")) RR.Select Of course, all the cells must be on the same worksheet. Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group, 1998 - 2009 Pearson Software Consulting, LLC www.cpearson.com (email on web site) On Sat, 12 Sep 2009 19:26:01 -0700, Alberto Ast wrote: Thanks for your input... but what if I need to select two separate ranges at the same time.... Resize only pick up a continuous range. For instance I need to select cells on col A,B,F,G,J on a specific row "Gord Dibben" wrote: ActiveCell.Resize(1, 5).Select Note: most times there is no need to select a range in order to work on it. ActiveCell.Resize(1, 5).Interior.ColorIndex = 3 Gord Dibben MS Excel MVP On Sat, 12 Sep 2009 17:50:01 -0700, Alberto Ast wrote: If I am in any cells how do I select same cell plus right cell plus cell thee spots to the right... my current cell location might vary. Thanks, |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks.. Your last comment plus Chip input mae my solution.
"Gord Dibben" wrote: ActiveCell.Resize(1, 5).Select Note: most times there is no need to select a range in order to work on it. ActiveCell.Resize(1, 5).Interior.ColorIndex = 3 Gord Dibben MS Excel MVP On Sat, 12 Sep 2009 17:50:01 -0700, Alberto Ast wrote: If I am in any cells how do I select same cell plus right cell plus cell thee spots to the right... my current cell location might vary. Thanks, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
select the range with the cell's position is a variable. | Excel Programming | |||
Can I make array position A(12) into a variable A(12*n) ? | Excel Worksheet Functions | |||
Select player from list and get his position in next column | Excel Discussion (Misc queries) | |||
Select a string without knowing position | Excel Programming | |||
Range.Select with variable cells ? | Excel Programming |