ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Dynamically obtaining a range from another range (https://www.excelbanter.com/excel-programming/348243-dynamically-obtaining-range-another-range.html)

Sharad Vyas

Dynamically obtaining a range from another range
 
Hi all,
I have a user defined range, where i am loading the data to be plotted on
the chart. I used max. # of rows and Colmns that can ever be used on the
chart, in defining this range. As the data is populated I want to obtain the
range from this range, which should contain the noempty cells only. I will
know how many rows and columns in user defined range will be there for a
given scenario.What is the best way? Here is what I ideally desi
MyRage - "A1 - E5" ( I defined this)
Loads data which has fills in "A1 - C3"
NewRange = MyRange.GetSomhow(A-1-C3")
Chart.SourceData = NewRange

Any thougths:
Thanks
-Sharad



Bernie Deitrick

Dynamically obtaining a range from another range
 
Sharad,

Set NewRange = myRange.SpecialCells(xlCellTypeConstants)

HTH,
Bernie
MS Excel MVP

"Sharad Vyas" wrote in message
...
Hi all,
I have a user defined range, where i am loading the data to be plotted on
the chart. I used max. # of rows and Colmns that can ever be used on the
chart, in defining this range. As the data is populated I want to obtain
the range from this range, which should contain the noempty cells only. I
will know how many rows and columns in user defined range will be there
for a given scenario.What is the best way? Here is what I ideally desi
MyRage - "A1 - E5" ( I defined this)
Loads data which has fills in "A1 - C3"
NewRange = MyRange.GetSomhow(A-1-C3")
Chart.SourceData = NewRange

Any thougths:
Thanks
-Sharad




Peter Huang [MSFT]

Dynamically obtaining a range from another range
 
Hi Sharad,

Did Bernie's suggestion help you?
If you still have any concern, please feel free to pos there.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.



All times are GMT +1. The time now is 10:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com