ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Setting a range that varies (https://www.excelbanter.com/excel-programming/325188-setting-range-varies.html)

Stephen English

Setting a range that varies
 
I am trying to create a chart from a range that has dates in Column a
(starting at Row 5) and share value in Column B
THis works
Range("A5:B7").Select
but what I can't find how to do is how to set it from A5 to the last cell
with data in column B rather than B7 because as I add data I want the chart
to update.

I am sure it is very simple.
Any clues please
Stephen



Bob Phillips[_6_]

Setting a range that varies
 

cLastRow = Cells(Rows.Count,"B").End(xlUp).Row
Range("A5:B" & cLastRwo).Select

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Stephen English" wrote in
message ...
I am trying to create a chart from a range that has dates in Column a
(starting at Row 5) and share value in Column B
THis works
Range("A5:B7").Select
but what I can't find how to do is how to set it from A5 to the last cell
with data in column B rather than B7 because as I add data I want the

chart
to update.

I am sure it is very simple.
Any clues please
Stephen





Jame

Setting a range that varies
 


"Bob Phillips" wrote:


cLastRow = Cells(Rows.Count,"B").End(xlUp).Row
Range("A5:B" & cLastRwo).Select

--
Bob,

Thanks for this. It helped me solve a problem that has been bugging me for 2
days.
HTH

RP
(remove nothere from the email address if mailing direct)


"Stephen English" wrote in
message ...
I am trying to create a chart from a range that has dates in Column a
(starting at Row 5) and share value in Column B
THis works
Range("A5:B7").Select
but what I can't find how to do is how to set it from A5 to the last cell
with data in column B rather than B7 because as I add data I want the

chart
to update.

I am sure it is very simple.
Any clues please
Stephen







All times are GMT +1. The time now is 09:03 AM.

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