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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Do you mean something like:

Code:
Return_val_col.cells(I,1).Font.Strikethrough = True
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,213,497
Messages
6,113,998
Members
448,541
Latest member
iparraguirre89

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
Back
Top