Undo a select operation?

R

Robert Crandal

This might be a dumb question, but here goes....

If I run this code:

Range("A12:M2").Select

is there a command that will "undo" or cancel the
selected region?
 
R

Robert Crandal

Robert Crandal said:
This might be a dumb question, but here goes....

If I run this code:

Range("A12:M2").Select

is there a command that will "undo" or cancel the
selected region?

My question might have been misworded, so I want to rephrase....

I'm not really looking for an "undo" command. I guess what I
would like to do is "turn off" the selected or highlighted region.
I thought maybe there would be an "Unselect" command, but
I guess not.

Maybe the best thing to do is select a singe cell, such as
Range("A1").Select???
 
C

Claus Busch

Hi Robert,

Am Mon, 13 May 2013 13:26:45 -0700 schrieb Robert Crandal:
Maybe the best thing to do is select a singe cell, such as
Range("A1").Select???

in this case you have to select another cell or another range.

What do you want to do? If you refer correctly, you don't have to use
select.


Regards
Claus Busch
 
R

Robert Crandal

Claus Busch said:
Hi Robert,

in this case you have to select another cell or another range.

What do you want to do? If you refer correctly, you don't have to use
select.

My workbook is locked to prevent users from editing data.
The workbook also contains a couple hundred rows of data.

Using VBA, my plan is to scroll down to one particular row
and highlight it using the "Select" function. This is only for the
purpose of making that row easiliy visible, not for the purpose
of a copy or delete operation, etc..

So, my only plan was to scroll down and make a row easily
visible, then turn off the highlight once done. It looks like
all I need to do is select another cell or range, right?
 
C

Claus Busch

Hi Robert,

Am Mon, 13 May 2013 13:52:03 -0700 schrieb Robert Crandal:
So, my only plan was to scroll down and make a row easily
visible, then turn off the highlight once done. It looks like
all I need to do is select another cell or range, right?

you must not scroll down. The selected range comes in the window.
And selecting another cell will turn off the border.


Regards
Claus Busch
 
J

joeu2004

Robert Crandal said:
I'm not really looking for an "undo" command. I guess
what I would like to do is "turn off" the selected or
highlighted region. I thought maybe there would be an
"Unselect" command, but I guess not.
Maybe the best thing to do is select a singe cell, such
as Range("A1").Select???

Exactly right. Something must always be selected.

Alternatively, to "undo" as you requested; that is, to revert to the
previous selection:

Dim oldSelection As Range
Set oldSelection = Selection
Range("A2:M12").Select
..... some time later ....
oldSelection.Select
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top