Thanks Chris!
I've taken what you had suggested and added a way to indentify the row as well. but it works great! this is the final code I've created... in case anyone else comes accross this problem
Thanks again Chris
Sub ColumnMatchTest()
Dim Cat As Range
Dim ColCat As Long
Dim MousePDay As Range
Dim RowMousePDay As Long
Set Cat = Worksheets("Sheet1").Cells.Find(What:="Cat", LookIn:=xlFormulas, LookAt:=xlWhole, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, _
SearchFormat:=False)
If Not Cat Is Nothing Then
ColCat = Cat.Column
Else
MsgBox ("Can't find cat")
Exit Sub
End If
Set MousePDay = Worksheets("Sheet1").Cells.Find(What:="Mouse/Day", LookIn:=xlFormulas, LookAt:=xlWhole, _
SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, _
SearchFormat:=False)
If Not MousePDay Is Nothing Then
RowMousePDay = MousePDay.Row
Else
MsgBox ("Can't find 'Mouse/Day'")
Exit Sub
End If
'obviously, this will just put the word Cat into the sheet, but I think you get the idea.
Worksheets("Sheet2").Cells(1, "D").Value = Worksheets("Sheet1").Cells(RowMousePDay, ColCat).Value
End Sub
Bookmarks