I found the following code which looks as though it will do what i want.
Private Sub mulholm()
Dim myRange As Range
Dim myCell As Range
Set myRange = Range("B15:B16")
For Each myCell In myRange
If myCell Like "*Department Total*" Then
myCell.Font.Bold = True
End If
Next myCell
End Sub
This works and will turn the word bold however what i want to achieve is that when "Department Total" is present in myrange then it will action an index/match function from another worksheet.
I have tried to do it by adding in the index/match macro but if doesnt work.
Private Sub mulholm()
Dim myRange As Range
Dim myCell As Range
Set myRange = Range("B15:B16")
For Each myCell In myRange
If myCell Like "*Department Total*" Then
"=INDEX('" & s & "'!R[-15]:R[1048559],MATCH(""Department Total"",'" & s & "'!C[-1],0),3)"
End If
Next myCell
End Sub
Private Sub mulholm()
Dim myRange As Range
Dim myCell As Range
Set myRange = Range("B15:B16")
For Each myCell In myRange
If myCell Like "*Department Total*" Then
myCell.Font.Bold = True
End If
Next myCell
End Sub
This works and will turn the word bold however what i want to achieve is that when "Department Total" is present in myrange then it will action an index/match function from another worksheet.
I have tried to do it by adding in the index/match macro but if doesnt work.
Private Sub mulholm()
Dim myRange As Range
Dim myCell As Range
Set myRange = Range("B15:B16")
For Each myCell In myRange
If myCell Like "*Department Total*" Then
"=INDEX('" & s & "'!R[-15]:R[1048559],MATCH(""Department Total"",'" & s & "'!C[-1],0),3)"
End If
Next myCell
End Sub