I have the following problem and it's driving me NUTS! I work on a large database program in Excel, and I'm trying to retrieve the row and column numbers of specific named ranges. The following code used to work (temp_entryvalue is the name of the range):
temp_datafile_row = Workbooks(datafile_filepath).Worksheets(temp_datafile_worksheet).Range(temp_entryvalue).Row
temp_datafile_col = Workbooks(datafile_filepath).Worksheets(temp_datafile_worksheet).Range(temp_entryvalue).Column
I get the ole' Error 1004. Troubleshooting a bit, the problem here seems to be that the range associated with temp_entryvalue is hidden in the excel sheet, however the name is defined and there is a row and column number assigned to.
This however, all used to work. Until I changed one thing: instead of writing directly to the database excel worksheet, I first put everything in an array, so that only at the very end I open the database worksheet and copy all the data. Before I did this, everything used to work fine.
So how do I fix this? How do I retrieve the row and column number of a Named Range that is hidden, but DOES have a row and column number associated to it?
Thanks.
question from:
https://stackoverflow.com/questions/65888635/row-and-column-of-a-named-excel-cell 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…