Selecting data programmatically

  • Thread starter Thread starter guest
  • Start date Start date
G

guest

Is there anyway we can programmatically select the data rows and columns that
the active cell belongs to? Similar what excel charting does.
For example in case of Excel chart you just select a single cell, and say
insert chart it automatically detects the data that the active cell is part
of and charts it.
 
Sub rowss()
ActiveCell.EntireRow.Select
End Sub

Sub columnss()
ActiveCell.EntireColumn.Select
End Sub
 
Hi Guest,
Set Rng = Activecell.CurrentReguon


Correcting a typo, try:

'=========>>
Public Sub Tester()
Dim Rng As Range

Set Rng = ActiveCell.CurrentRegion
MsgBox Rng.Address(0, 0)

End Sub
'<<=========
 
Yes.

If you want the "table" that the cell is a part of, follow Norman's
suggestion:

Sub missive()
ActiveCell.CurrentRegion.Select
End Sub
 
thanks.

Norman Jones said:
Hi Guest,



Correcting a typo, try:

'=========>>
Public Sub Tester()
Dim Rng As Range

Set Rng = ActiveCell.CurrentRegion
MsgBox Rng.Address(0, 0)

End Sub
'<<=========
 

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