How to strikethrough a returned value with vba?

Grigoris

New Member
Joined
Jun 23, 2015
Messages
2
Hi.

I have put together some code lines I found while searching web, on how a value is returned after 2 conditions are met. I would like to develop further the below code in order to strike-through the returned value.
I will appreciated if someone can help me.

Function Lookup_concat(Search_string As String, _
Search_in_col As Range, Return_val_col As Range)

Dim i As Long
Dim result As String

For i = 1 To Search_in_col.Count
If Search_in_col.Cells(i, 1) = Search_string And Search_in_col.Cells(i, 3) = 100 Then
result = result & "> " & Return_val_col.Cells(i, 1).Value & vbNewLine
\\\ need to strike-through Return_val_col.Cells(i, 1).Value at this point
ElseIf Search_in_col.Cells(i, 1) = Search_string Then
result = result & Return_val_col.Cells(i, 1).Value & vbNewLine
End If

Next

Lookup_concat = Trim(result)

End Function

Thx
 

Some videos you may like

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

kdave

Board Regular
Joined
Feb 23, 2015
Messages
77
Do you mean something like:

Code:
Return_val_col.cells(I,1).Font.Strikethrough = True
 

Grigoris

New Member
Joined
Jun 23, 2015
Messages
2
Thank you kdave for the feedback but i have already tried this. The code searchs a value within an array and returns the value in the cell which equals to the search condition. When i use the code u provided the value is not returned at all.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,125
Messages
5,599,856
Members
414,342
Latest member
K Darrell Smith

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top