View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default Getting and Saving a Cell Reference

hi,
try working something like this into your macro..
Sub arc()
Dim a As String
Dim b As String
Dim c As Long
Dim d As Long
a = InputBox("enter something")
Cells.Find(What:="a", After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False).Activate
b = ActiveCell.Address
c = ActiveCell.Row
d = ActiveCell.Column
MsgBox b
MsgBox c
MsgBox d

End Sub
the code is wordy but only to show your the 3 items you mentioned. row,
column and/or address.

regards
FSt1
"Marco" wrote:

I am searching in a table for a specific heading, for example ABS. Now as I
am receiving this information from a 3rd party, that ABS could be in column
10 on one file, but in column 54 in the next. I would like to retreive the
column number of that heading, store it within the macro to use for sorting
and other funtions I am creating. How can I get just the column, or just the
row, or both if I need it. The address function is what I would use in Excel.

Thanks.