A simple droplist to change text atributes

Theo6772

New Member
Joined
Dec 20, 2020
Messages
6
Office Version
  1. 2007
Platform
  1. Windows
The title says the most. I want to make a form to be printed or send by e-mail. It's digital succession of a paper form. The user must strike out three out of four words. This to be achieved bij choosing the correct word shown in a ListBox.
I'm a first time user on VBA and so I get very confused of the masses of samples I have found on so many places.
I would really appreciate the help.
Thanks in advance!
 
You have to download the file to your computer and open it with Excel.
Excel on OneDrive doesn't support VBA/Macros.
 
Upvote 0

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Wow! This works nice! And I can even secure the worksheet. Thank you!
 
Upvote 0
Wow! This works nice! And I can even secure the worksheet. Thank you!
You're welcome!

One more thing. You can remove the following line. It does nothing at all. It's a leftover from my coding. Sorry about that.
VBA Code:
        Dim T As Range

So the code should look like this afterwards:
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Select Case Target.Address
        Case Range("B5").Address
            Call str("B5")
        Case Range("D5").Address
            Call str("D5")
        Case Range("F5").Address
            Call str("F5")
                Case Range("H5").Address
            Call str("H5")
    End Select
End Sub
Public Sub str(ByVal S As String)
        If Range(S).Font.Strikethrough = True Then
            Range(S).Font.Strikethrough = False
        Else
            Range(S).Font.Strikethrough = True
        End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,500
Messages
6,125,166
Members
449,210
Latest member
grifaz

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