Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referencing cells safely
Hello,
I am trying to find the best way to refer to cells in a large range based on the column they are under. The number and order of columns in the range is changed frequently and I want to make sure that the reference always works, so I can't simply hard-code a column number. Right now, I determine the column that I am interested in by providing a Name to the column header and finding the column number from the Named cell. The problem with this is that the number of named cells is getting quite large and confusing. Does anyone know any better ways of doing this? Thanks, David |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referencing cells safely
If the cell will have consistent data, you could think about using the Find
feature and set the cell(s) to a range. Or, if you have consistent column/row headers, you can find those and use the Column and Row numbers from each respectively (using the Cells method). HTH -- Regards, Zack Barresse, aka firefytr MsgBox "fire" & "fytr" & Chr(64) & "vba" & "express" & Chr(46) & "com" "David G" wrote in message ups.com... Hello, I am trying to find the best way to refer to cells in a large range based on the column they are under. The number and order of columns in the range is changed frequently and I want to make sure that the reference always works, so I can't simply hard-code a column number. Right now, I determine the column that I am interested in by providing a Name to the column header and finding the column number from the Named cell. The problem with this is that the number of named cells is getting quite large and confusing. Does anyone know any better ways of doing this? Thanks, David |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referencing cells safely
Thanks for your suggestion. Unfortunately, the data in any cell is
subject to change, including column headers. I think it is safe to assume, though, that the meaning of columns does not change, even if the header does. For example, if the header is changed from "Name" to "ID", the column still represents the same data. I must admit, I don't know exactly what kind of solution I am looking for. I'm just looking for suggestions to see if any would fit the requirements for this task. On Feb 26, 4:43 pm, "Zack Barresse" wrote: If the cell will have consistent data, you could think about using the Find feature and set the cell(s) to a range. Or, if you have consistent column/row headers, you can find those and use the Column and Row numbers from each respectively (using the Cells method). HTH -- Regards, Zack Barresse, aka firefytr MsgBox "fire" & "fytr" & Chr(64) & "vba" & "express" & Chr(46) & "com" "David G" wrote in message ups.com... Hello, I am trying to find the best way to refer to cells in a large range based on the column they are under. The number and order of columns in the range is changed frequently and I want to make sure that the reference always works, so I can't simply hard-code a column number. Right now, I determine the column that I am interested in by providing a Name to the column header and finding the column number from the Named cell. The problem with this is that the number of named cells is getting quite large and confusing. Does anyone know any better ways of doing this? Thanks, David |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referencing cells safely
A Name will work then, yes. As long as you have something that will
identify that and be constant. Whether that be a value, formula, partial text, after a certain position/value, etc. Whatever you can logically use to deduce the location. If you do not have a unique criterion, create one. Does that answer your question? -- Regards, Zack Barresse, aka firefytr MsgBox "fire" & "fytr" & Chr(64) & "vba" & "express" & Chr(46) & "com" "David G" wrote in message oups.com... Thanks for your suggestion. Unfortunately, the data in any cell is subject to change, including column headers. I think it is safe to assume, though, that the meaning of columns does not change, even if the header does. For example, if the header is changed from "Name" to "ID", the column still represents the same data. I must admit, I don't know exactly what kind of solution I am looking for. I'm just looking for suggestions to see if any would fit the requirements for this task. On Feb 26, 4:43 pm, "Zack Barresse" wrote: If the cell will have consistent data, you could think about using the Find feature and set the cell(s) to a range. Or, if you have consistent column/row headers, you can find those and use the Column and Row numbers from each respectively (using the Cells method). HTH -- Regards, Zack Barresse, aka firefytr MsgBox "fire" & "fytr" & Chr(64) & "vba" & "express" & Chr(46) & "com" "David G" wrote in message ups.com... Hello, I am trying to find the best way to refer to cells in a large range based on the column they are under. The number and order of columns in the range is changed frequently and I want to make sure that the reference always works, so I can't simply hard-code a column number. Right now, I determine the column that I am interested in by providing a Name to the column header and finding the column number from the Named cell. The problem with this is that the number of named cells is getting quite large and confusing. Does anyone know any better ways of doing this? Thanks, David |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Referencing cells safely
Yes, it does. Thank you.
On Feb 28, 4:08 pm, "Zack Barresse" wrote: A Name will work then, yes. As long as you have something that will identify that and be constant. Whether that be a value, formula, partial text, after a certain position/value, etc. Whatever you can logically use to deduce the location. If you do not have a unique criterion, create one. Does that answer your question? -- Regards, Zack Barresse, aka firefytr MsgBox "fire" & "fytr" & Chr(64) & "vba" & "express" & Chr(46) & "com" "David G" wrote in message oups.com... Thanks for your suggestion. Unfortunately, the data in any cell is subject to change, including column headers. I think it is safe to assume, though, that the meaning of columns does not change, even if the header does. For example, if the header is changed from "Name" to "ID", the column still represents the same data. I must admit, I don't know exactly what kind of solution I am looking for. I'm just looking for suggestions to see if any would fit the requirements for this task. On Feb 26, 4:43 pm, "Zack Barresse" wrote: If the cell will have consistent data, you could think about using the Find feature and set the cell(s) to a range. Or, if you have consistent column/row headers, you can find those and use the Column and Row numbers from each respectively (using the Cells method). HTH -- Regards, Zack Barresse, aka firefytr MsgBox "fire" & "fytr" & Chr(64) & "vba" & "express" & Chr(46) & "com" "David G" wrote in message roups.com... Hello, I am trying to find the best way to refer to cells in a large range based on the column they are under. The number and order of columns in the range is changed frequently and I want to make sure that the reference always works, so I can't simply hard-code a column number. Right now, I determine the column that I am interested in by providing a Name to the column header and finding the column number from the Named cell. The problem with this is that the number of named cells is getting quite large and confusing. Does anyone know any better ways of doing this? Thanks, David |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
where can i get Cholesky decomposition add ins safely? | Excel Worksheet Functions | |||
Looking for Present Value I Can Copy and Paste Safely | Excel Discussion (Misc queries) | |||
Closing Excel Safely within a Web Environment | Excel Programming | |||
How Many Simultaneous Users Can Be Safely Handled? | Excel Programming | |||
safely open file | Excel Programming |