ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I write an Excel macro when the cell range changes weekly? (https://www.excelbanter.com/excel-discussion-misc-queries/169464-how-do-i-write-excel-macro-when-cell-range-changes-weekly.html)

AT

How do I write an Excel macro when the cell range changes weekly?
 
I need to write a macro but the range of data will change every time I access
the report. I don't know how to specify a range that isn't static.

excelent

How do I write an Excel macro when the cell range changes weekly?
 
last non empty cell in column A :
rw=sheets("Sheet1").cells(65536,1).end(xlup).row

or select from activecell to last cell :
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select

"AT" skrev:

I need to write a macro but the range of data will change every time I access
the report. I don't know how to specify a range that isn't static.


Gord Dibben

How do I write an Excel macro when the cell range changes weekly?
 
Data is in multi-rows and columns or in one column or??

What you want is doable but need more info please.

Example...................

Set rng = Range(Range("B1"), Cells(Rows.Count, 2).End(xlUp))

rng will be from B1 down to the last cell in column B with data


Gord Dibben MS Excel MVP


On Wed, 12 Dec 2007 13:15:00 -0800, AT wrote:

I need to write a macro but the range of data will change every time I access
the report. I don't know how to specify a range that isn't static.



Jim Thomlinson

How do I write an Excel macro when the cell range changes weekly?
 
Define "isn't static"... Increasing rows? Increasing columns? Address changing?
--
HTH...

Jim Thomlinson


"AT" wrote:

I need to write a macro but the range of data will change every time I access
the report. I don't know how to specify a range that isn't static.



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

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