ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Dynamically filling a static name (for querying an Excel range) (https://www.excelbanter.com/excel-programming/315252-dynamically-filling-static-name-querying-excel-range.html)

Air_Cooled_Nut[_7_]

Dynamically filling a static name (for querying an Excel range)
 

keepITcool...good points, I'll hopefully address those in this response.
If you couldn't tell, I am somewhat new to this.

Some of your Range references are unqualified. For instance, if you were
on
a sheet other than "sheetname" it would cause problems.

Oops, I was using "sheetname" in a generic sense. Yes, it is set to my
specific sheet's name. I can see the confusion because I was explicit
with my Range.

Question 1: You are correct, the headers are part of the Edb. Just so
we're clear, I wasn't the one who created this db, I was just assigned
to create a data entry form and report from it.

Question 2:
Drat, I should've been more specific, my bad. I was assuming anyone
using it would put it where ever they needed it. The code is executed
in the _BeforeClose event because the user can also edit their data
i.e. the data entry form isn't used. The data set is rather small
(<400 rows and < 52 columns).

Don't use the Select method unless you have a good reason. This isn't
one.

Please explain why. I do understand your line of code, just wondering
how one knows when to use Select?

Thanks!


--
Air_Cooled_Nut


------------------------------------------------------------------------
Air_Cooled_Nut's Profile: http://www.excelforum.com/member.php...o&userid=15730
View this thread: http://www.excelforum.com/showthread...hreadid=273685



All times are GMT +1. The time now is 05:25 PM.

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