Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
hi,
How can I write a code in a way to select the range A to F columns one row less than active cell row no. . For example if the activecell address is D3 the range will be selected like A2:F2. Thanks for your help. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sub ordinate()
n = ActiveCell.Row - 1 Range("A" & n & ":F" & n).Select End Sub -- Gary''s Student - gsnu200833 "peyman" wrote: hi, How can I write a code in a way to select the range A to F columns one row less than active cell row no. . For example if the activecell address is D3 the range will be selected like A2:F2. Thanks for your help. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() thanx Gary for your prompt reply.I'll try that "Gary''s Student" wrote: Sub ordinate() n = ActiveCell.Row - 1 Range("A" & n & ":F" & n).Select End Sub -- Gary''s Student - gsnu200833 "peyman" wrote: hi, How can I write a code in a way to select the range A to F columns one row less than active cell row no. . For example if the activecell address is D3 the range will be selected like A2:F2. Thanks for your help. |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() it works well. Thanks again "Gary''s Student" wrote: Sub ordinate() n = ActiveCell.Row - 1 Range("A" & n & ":F" & n).Select End Sub -- Gary''s Student - gsnu200833 "peyman" wrote: hi, How can I write a code in a way to select the range A to F columns one row less than active cell row no. . For example if the activecell address is D3 the range will be selected like A2:F2. Thanks for your help. |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
If I've understood correctly then try this Range("A" & ActiveCell.Row - 1 & ":F" & ActiveCell.Row - 1).Select Mike "peyman" wrote: hi, How can I write a code in a way to select the range A to F columns one row less than active cell row no. . For example if the activecell address is D3 the range will be selected like A2:F2. Thanks for your help. |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
yes Mike this works too.Thanks
"Mike H" wrote: Hi, If I've understood correctly then try this Range("A" & ActiveCell.Row - 1 & ":F" & ActiveCell.Row - 1).Select Mike "peyman" wrote: hi, How can I write a code in a way to select the range A to F columns one row less than active cell row no. . For example if the activecell address is D3 the range will be selected like A2:F2. Thanks for your help. |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Your welcome
"peyman" wrote: yes Mike this works too.Thanks "Mike H" wrote: Hi, If I've understood correctly then try this Range("A" & ActiveCell.Row - 1 & ":F" & ActiveCell.Row - 1).Select Mike "peyman" wrote: hi, How can I write a code in a way to select the range A to F columns one row less than active cell row no. . For example if the activecell address is D3 the range will be selected like A2:F2. Thanks for your help. |
#8
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
Here is another way: ActiveCell.Offset(-1, -3).Resize(, 6).Select -- If this helps, please click the Yes button Cheers, Shane Devenshire "peyman" wrote: hi, How can I write a code in a way to select the range A to F columns one row less than active cell row no. . For example if the activecell address is D3 the range will be selected like A2:F2. Thanks for your help. |
#9
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Here is yet another way...
Range("A1:F1").Offset(ActiveCell.Row - 2).Select -- Rick (MVP - Excel) "peyman" wrote in message ... hi, How can I write a code in a way to select the range A to F columns one row less than active cell row no. . For example if the activecell address is D3 the range will be selected like A2:F2. Thanks for your help. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
where can I see my question and answer? Yesterday I ask a question | Excel Discussion (Misc queries) | |||
VBA Question | Excel Discussion (Misc queries) | |||
if question | Excel Worksheet Functions | |||
Newbie Question - Subtraction Formula Question | Excel Discussion (Misc queries) | |||
The question is an excel question that I need to figure out howto do in excel. | Excel Worksheet Functions |