Yet another Newby question about selecting

  • Thread starter Thread starter TBA
  • Start date Start date
T

TBA

My noobness is not diminishing at the pace I was hoping for, so here's
another nooby question:

I want to write the code that will select a table based in the currently
selected cell. I was thinking something simple like:

Range(???).CurrentRegion.Select

but I don't know how to equate the ??? to the currently selected cell .


Side question: is the currently selected cell also known as the ActiveCell?

Thank you for your patience.

-gk-
 
Chip Pearson said:
You can use something like

ActiveCell.CurrentRegion.Select

Doesn't seem to be working. I'm executing the procedure via a command
button on the worksheet itself - is this a problem? It looks like this:

Private Sub CommandButton2_Click()
ActiveCell.CurrentRegion.Select
End Sub

-gk-
 
I haven't seen the beginning of this thread, but if you are trying to create a macro that does
nothing but what you show below, you don't need a macro and button for that. Excel has a
shortcut key. From Help:

CTRL+SHIFT+* (asterisk): Select the current region around the active cell (the data area
enclosed by blank rows and blank columns). In a PivotTable report, select the entire PivotTable
report.

What version of Excel are you using? Have you set the TakeFocusOnClick property of your button
to False? If you haven't, that may be the problem. There's no ActiveCell once you click the
button (it's a bug, fixed in later versions).
 
Myrna Larson said:
I haven't seen the beginning of this thread, but if you are trying to create a macro that does
nothing but what you show below, you don't need a macro and button for that. Excel has a
shortcut key. From Help:

CTRL+SHIFT+* (asterisk): Select the current region around the active cell (the data area
enclosed by blank rows and blank columns). In a PivotTable report, select the entire PivotTable
report.

What version of Excel are you using? Have you set the TakeFocusOnClick property of your button
to False? If you haven't, that may be the problem. There's no ActiveCell once you click the
button (it's a bug, fixed in later versions).

That did it! And I never would have thought to look there. Thank you!

Excel 97

-gk-
 
Back
Top