Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Selecting data programmatically

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Selecting data programmatically

Sub rowss()
ActiveCell.EntireRow.Select
End Sub

Sub columnss()
ActiveCell.EntireColumn.Select
End Sub


--
Gary''s Student - gsnu200785


"guest" wrote:

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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Selecting data programmatically

I think this logic selects only one row and one column or am I missing
something here?



"Gary''s Student" wrote:

Sub rowss()
ActiveCell.EntireRow.Select
End Sub

Sub columnss()
ActiveCell.EntireColumn.Select
End Sub


--
Gary''s Student - gsnu200785


"guest" wrote:

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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default Selecting data programmatically

Hi Guest,

Try:

Dim Rng As Range

Set Rng = Activecell.CurrentReguon



---
Regards.
Norman


"guest" wrote in message
...
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.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default Selecting data programmatically

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
'<<=========


---
Regards.
Norman


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Selecting data programmatically

Yes.

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

Sub missive()
ActiveCell.CurrentRegion.Select
End Sub

--
Gary''s Student - gsnu200785


"guest" wrote:

I think this logic selects only one row and one column or am I missing
something here?



"Gary''s Student" wrote:

Sub rowss()
ActiveCell.EntireRow.Select
End Sub

Sub columnss()
ActiveCell.EntireColumn.Select
End Sub


--
Gary''s Student - gsnu200785


"guest" wrote:

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.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Selecting data programmatically

thanks.

"Norman Jones" wrote:

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
'<<=========


---
Regards.
Norman

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting range programmatically Barb Reinhardt Excel Programming 1 September 20th 06 01:58 PM
Programmatically selecting first worksheet Barb Reinhardt Excel Programming 1 July 14th 06 12:38 AM
Programmatically selecting first worksheet Barb Reinhardt Excel Programming 4 July 13th 06 11:42 PM
Selecting most of very many programmatically Tony Rizzo[_2_] Excel Programming 2 July 27th 05 08:50 PM
Selecting Rows Programmatically Aaron Lampkin Excel Programming 1 September 5th 03 01:42 PM


All times are GMT +1. The time now is 05:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"