In Excel 2003, I use VBA code to find the column with a specific title.
The Find works well as long as the column is not hidden. Unfortunately it
has to be hidden and I don't want to hard-code the column address.
Suggestions welcomed!
Thanks - Pat
Dave Peterson - 11 Oct 2008 14:57 GMT
Turn screenupdating off.
Unhide the columns
do the find
hide the columns
turn screenupdating on
> In Excel 2003, I use VBA code to find the column with a specific title.
> The Find works well as long as the column is not hidden. Unfortunately it
> has to be hidden and I don't want to hard-code the column address.
> Suggestions welcomed!
> Thanks - Pat

Signature
Dave Peterson
Dave Peterson - 11 Oct 2008 14:59 GMT
Or you could loop through the cells in the header column looking for your key
value.
> In Excel 2003, I use VBA code to find the column with a specific title.
> The Find works well as long as the column is not hidden. Unfortunately it
> has to be hidden and I don't want to hard-code the column address.
> Suggestions welcomed!
> Thanks - Pat

Signature
Dave Peterson
Dreiding - 11 Oct 2008 16:00 GMT
Well duh. I should have though of this.
Thanks,
- Pat
> Or you could loop through the cells in the header column looking for your key
> value.
[quoted text clipped - 4 lines]
> > Suggestions welcomed!
> > Thanks - Pat
Don Guillett - 11 Oct 2008 15:07 GMT
Doesn't care if hidden.
Sub findhiddencol()
MsgBox Rows(1).Find("specific title").Column
End Sub

Signature
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguillett1@austin.rr.com
> In Excel 2003, I use VBA code to find the column with a specific title.
> The Find works well as long as the column is not hidden. Unfortunately it
> has to be hidden and I don't want to hard-code the column address.
> Suggestions welcomed!
> Thanks - Pat
Dreiding - 11 Oct 2008 15:58 GMT
Don,
I'm sorry to say, at least for my environment, it does care if the column is
hidden.
I'm using Dave Peterson suggestion of looping through each cell.
- Pat
> Doesn't care if hidden.
>
[quoted text clipped - 7 lines]
> > Suggestions welcomed!
> > Thanks - Pat