RANGE SELECTION

  • Thread starter Thread starter FARAZ QURESHI
  • Start date Start date
F

FARAZ QURESHI

Suppose I want to select a range of empty cells. The following piece of code
also selects the last non-blank cell as well:

Range(Selection, Selection.End(xlUp)).Select

I want the selection to be of only blanks, in othjer words SHIFT + Down
Arrow once.

Looking forward for your guidance!

Thanx in advance,

Regards

FARAZ!!!
 
<<Suppose I want to select a range of empty cells.>>

Where is the current selection? In a range of cells that are already blank,
or in the middle of a range of data?

<<The following piece of code also selects the last non-blank cell as
well:>>
Range(Selection, Selection.End(xlUp)).Select

No, it does not. The above code selects from the current selection up to
the end of the data block or end of blank cells, depending on where the
selection is when you start.

<<I want the selection to be of only blanks, in othjer words SHIFT + Down
Arrow once.>>

Shift+Down Arrow is conflicting with the code you showed above (xlUp)!
Shift+Down Arrow will increase the selection in the DOWN direction, not UP,
as performed by the code above.
 

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

Back
Top