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
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,708
Messages
5,833,245
Members
430,200
Latest member
ADLHMA2022

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