ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Dynamic range (https://www.excelbanter.com/excel-programming/345672-dynamic-range.html)

[email protected]

Dynamic range
 
Hello:

My problem:
I would like to be able to dynamicaly determine the range of cells that
have data. This data is generated by a database query. I have the
script clear the old data before a new database query.

Is it possible to do that in excel?

Thanks,
--D


Tom Ogilvy

Dynamic range
 
Range("A1").currentRegion.Select

--
Regards,
Tom Ogilvy


wrote in message
oups.com...
Hello:

My problem:
I would like to be able to dynamicaly determine the range of cells that
have data. This data is generated by a database query. I have the
script clear the old data before a new database query.

Is it possible to do that in excel?

Thanks,
--D




Chip Pearson

Dynamic range
 
It depends on how your worksheet is organized. If the data is
always enclosed between blank rows/columns, you can use

Dim DataRange As Range
Set DataRange = Range("A1").CurrentRegion

to get the rectangular region of data.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




wrote in message
oups.com...
Hello:

My problem:
I would like to be able to dynamicaly determine the range of
cells that
have data. This data is generated by a database query. I have
the
script clear the old data before a new database query.

Is it possible to do that in excel?

Thanks,
--D




[email protected]

Dynamic range
 
Thank you guys!
Very helpfull sugestions, exactly what I was looking for

Thanks,
-D



All times are GMT +1. The time now is 07:31 PM.

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