Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Excel Addin:Setting the range to the Excel.Range object range prop

Hi,

How do we set the entire Excel worksheet as a range to the Excel Range
object's range property? I know we can set a particular column or from one
cell to another cell as a range to Excel Range object's range property but
how to set the entire worksheet as a range.

Any ideas, please share.

thanks in advance,
-Ram.


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 14
Default Excel Addin:Setting the range to the Excel.Range object range prop


If you mean all the cells in a worksheet and not the entire worksheet
itself then

public sub selectAllCells()
dim r as range
set r = cells
r.select
end sub

but if you just want to select all the cells from the sheet to
copy/paste/delete/whatever then:

cells.select

is your best friend.

Cheers,
JAson Lepack



Rp007 wrote:
Hi,

How do we set the entire Excel worksheet as a range to the Excel Range
object's range property? I know we can set a particular column or from one
cell to another cell as a range to Excel Range object's range property but
how to set the entire worksheet as a range.

Any ideas, please share.

thanks in advance,
-Ram.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Excel Addin:Setting the range to the Excel.Range object range

Hi,

thanks very much for the details... it solved the problem. However it
raised one more query now setting up a particular column(entire column alone)
as a range to Range object's range property. Has any clue.

thanks,
-Ram.

"jlepack" wrote:


If you mean all the cells in a worksheet and not the entire worksheet
itself then

public sub selectAllCells()
dim r as range
set r = cells
r.select
end sub

but if you just want to select all the cells from the sheet to
copy/paste/delete/whatever then:

cells.select

is your best friend.

Cheers,
JAson Lepack



Rp007 wrote:
Hi,

How do we set the entire Excel worksheet as a range to the Excel Range
object's range property? I know we can set a particular column or from one
cell to another cell as a range to Excel Range object's range property but
how to set the entire worksheet as a range.

Any ideas, please share.

thanks in advance,
-Ram.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 14
Default Excel Addin:Setting the range to the Excel.Range object range

Range("A:A").select will select the "A" column.

Range("2:2").select will select the "2" row.

Range("A1").select will select cell "A1".

Cheers,
Jason Lepack


Rp007 wrote:
Hi,

thanks very much for the details... it solved the problem. However it
raised one more query now setting up a particular column(entire column alone)
as a range to Range object's range property. Has any clue.

thanks,
-Ram.

"jlepack" wrote:


If you mean all the cells in a worksheet and not the entire worksheet
itself then

public sub selectAllCells()
dim r as range
set r = cells
r.select
end sub

but if you just want to select all the cells from the sheet to
copy/paste/delete/whatever then:

cells.select

is your best friend.

Cheers,
JAson Lepack



Rp007 wrote:
Hi,

How do we set the entire Excel worksheet as a range to the Excel Range
object's range property? I know we can set a particular column or from one
cell to another cell as a range to Excel Range object's range property but
how to set the entire worksheet as a range.

Any ideas, please share.

thanks in advance,
-Ram.




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Excel Addin:Setting the range to the Excel.Range object range

Hi,

I tried it, but its not working. Here I am using C# and trying to set
Excel's Range object as:
Excel rng = (Excel.Range)Excel.get_Range("Cell1", "Cell2");

Here get_Range method only accepts 2 arguments. So couldn't able to set the
entire column selection.

Any ideas on the above, please share.

thanks,
-Ram.





"jlepack" wrote:

Range("A:A").select will select the "A" column.

Range("2:2").select will select the "2" row.

Range("A1").select will select cell "A1".

Cheers,
Jason Lepack


Rp007 wrote:
Hi,

thanks very much for the details... it solved the problem. However it
raised one more query now setting up a particular column(entire column alone)
as a range to Range object's range property. Has any clue.

thanks,
-Ram.

"jlepack" wrote:


If you mean all the cells in a worksheet and not the entire worksheet
itself then

public sub selectAllCells()
dim r as range
set r = cells
r.select
end sub

but if you just want to select all the cells from the sheet to
copy/paste/delete/whatever then:

cells.select

is your best friend.

Cheers,
JAson Lepack



Rp007 wrote:
Hi,

How do we set the entire Excel worksheet as a range to the Excel Range
object's range property? I know we can set a particular column or from one
cell to another cell as a range to Excel Range object's range property but
how to set the entire worksheet as a range.

Any ideas, please share.

thanks in advance,
-Ram.






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 14
Default Excel Addin:Setting the range to the Excel.Range object range

Ah, herein lies the problem. I've been assuming you were using VBA.
You're actually using C#...

rng = (Excel.Range)Excel.get_range("A1", "A1")
rng = (Excel.Range)rng.entirecolumn

I think that might work. I don't use C# with Excel so that's what my 5
minutes of research came up with.

Cheers,
Jason Lepack


Anyways... If I'm not mistaken, get_range takes an input of two cells,
and if they're the same then it selects that cell, otherwise it selects
the range.
Rp007 wrote:
Hi,

I tried it, but its not working. Here I am using C# and trying to set
Excel's Range object as:
Excel rng = (Excel.Range)Excel.get_Range("Cell1", "Cell2");

Here get_Range method only accepts 2 arguments. So couldn't able to set the
entire column selection.

Any ideas on the above, please share.

thanks,
-Ram.





"jlepack" wrote:

Range("A:A").select will select the "A" column.

Range("2:2").select will select the "2" row.

Range("A1").select will select cell "A1".

Cheers,
Jason Lepack


Rp007 wrote:
Hi,

thanks very much for the details... it solved the problem. However it
raised one more query now setting up a particular column(entire column alone)
as a range to Range object's range property. Has any clue.

thanks,
-Ram.

"jlepack" wrote:


If you mean all the cells in a worksheet and not the entire worksheet
itself then

public sub selectAllCells()
dim r as range
set r = cells
r.select
end sub

but if you just want to select all the cells from the sheet to
copy/paste/delete/whatever then:

cells.select

is your best friend.

Cheers,
JAson Lepack



Rp007 wrote:
Hi,

How do we set the entire Excel worksheet as a range to the Excel Range
object's range property? I know we can set a particular column or from one
cell to another cell as a range to Excel Range object's range property but
how to set the entire worksheet as a range.

Any ideas, please share.

thanks in advance,
-Ram.





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
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
Mailing an excel range in the body of an e-mail Andy Tallent Excel Discussion (Misc queries) 4 April 25th 12 10:14 AM
How do I insert a 2-3 page Excel spreadsheet as an object in MS Wo D at Spectra Excel Discussion (Misc queries) 0 May 15th 06 07:39 PM
Using a range variable inside a excel function Michael Excel Discussion (Misc queries) 2 November 14th 05 02:52 PM
pivotcell object to excel 2000 Kellyc Excel Discussion (Misc queries) 0 December 1st 04 03:45 PM


All times are GMT +1. The time now is 02:59 PM.

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

About Us

"It's about Microsoft Excel"