How do I add a command to an existing formula?

magpye

New Member
Joined
Jul 16, 2002
Messages
25
I'm a very small user of Excel, only used for a couple of projects, nothing too fancy, I usually get stuck on the most simple bits & on reading the manuals I get to the stage where "I can't see the wood for the trees."

Below is a copy of a formula that was given to me sometime ago that works well, thank you.

As time has gone on I've found that I would like to extend this to another column, B16:B24.

Could someone please tell me/show me how to go about inserting the additional command?



SHEET 1

Private Sub Worksheet_Change(ByVal Target As Range)
If Not (Application.Intersect(Target, Range("E16:E42")) Is Nothing) Then
With Target
If Not .HasFormula Then
.Value = UCase(.Value)
End If
End With
End If
End Sub
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Try

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not (Application.Intersect(Target, Range("B16:B42,E16:E42")) Is Nothing) Then
    With Target
        If Not .HasFormula Then
            .Value = UCase(.Value)
        End If
    End With
End If
End Sub
 
Upvote 0
That was quick, thanks very much, works well.

I wondered if that was the answer, better to be safe than sorry though, going on my past experience. :-)

John
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,909
Members
452,949
Latest member
beartooth91

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