ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Active cell as range (https://www.excelbanter.com/excel-programming/362718-active-cell-range.html)

Patrick Simonds

Active cell as range
 
How can I make the code below refer to the current cell that is active?


Set rng = Range("A200")



Jim Thomlinson

Active cell as range
 
set rng = activecell
--
HTH...

Jim Thomlinson


"Patrick Simonds" wrote:

How can I make the code below refer to the current cell that is active?


Set rng = Range("A200")




Patrick Simonds

Active cell as range
 
This did not work. I should add a little more explanation of what I want to
achieve.

If the current active cell is A5 (R5C1), I need that to be the Range set for
the other worksheets the macro cycles through. But the Range set needs to be
what ever the active cell is at the time the macro is run.
"Jim Thomlinson" wrote in message
...
set rng = activecell
--
HTH...

Jim Thomlinson


"Patrick Simonds" wrote:

How can I make the code below refer to the current cell that is active?


Set rng = Range("A200")






Tom Ogilvy

Active cell as range
 
s = ActiveCell.Address
for each sh in Thisworkbook.Worksheets
set rng = sh.Range(s)

Next

--
Regards,
Tom Ogilvy

"Patrick Simonds" wrote in message
...
This did not work. I should add a little more explanation of what I want

to
achieve.

If the current active cell is A5 (R5C1), I need that to be the Range set

for
the other worksheets the macro cycles through. But the Range set needs to

be
what ever the active cell is at the time the macro is run.
"Jim Thomlinson" wrote in

message
...
set rng = activecell
--
HTH...

Jim Thomlinson


"Patrick Simonds" wrote:

How can I make the code below refer to the current cell that is active?


Set rng = Range("A200")








Patrick Simonds

Active cell as range
 
Thank you

"Tom Ogilvy" wrote in message
...
s = ActiveCell.Address
for each sh in Thisworkbook.Worksheets
set rng = sh.Range(s)

Next

--
Regards,
Tom Ogilvy

"Patrick Simonds" wrote in message
...
This did not work. I should add a little more explanation of what I want

to
achieve.

If the current active cell is A5 (R5C1), I need that to be the Range set

for
the other worksheets the macro cycles through. But the Range set needs to

be
what ever the active cell is at the time the macro is run.
"Jim Thomlinson" wrote in

message
...
set rng = activecell
--
HTH...

Jim Thomlinson


"Patrick Simonds" wrote:

How can I make the code below refer to the current cell that is
active?


Set rng = Range("A200")











All times are GMT +1. The time now is 07:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com