Hello All,
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o> </o>
I use the following two macros in a workbook that I would like to combine them into a single Worksheet Change event macro and am not sure how to go about this, so any help would be very much appreciated.
<o> </o>
The first macro is installed in the worksheet and the second is installed in a module.
<o> </o>
Sheet 1 Code<o></o>
<o> </o>
Module Code<o></o>
<o> </o>
Thanking you in advance.
<o> </o>
Regards,
Dave T
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o> </o>
I use the following two macros in a workbook that I would like to combine them into a single Worksheet Change event macro and am not sure how to go about this, so any help would be very much appreciated.
<o> </o>
The first macro is installed in the worksheet and the second is installed in a module.
<o> </o>
Sheet 1 Code<o></o>
Code:
[/SIZE][/FONT]
[SIZE=3][FONT=Arial]Option Explicit<o:p></o:p>[/FONT][/SIZE]
<o:p>[FONT=Arial][SIZE=3] [/SIZE][/FONT]</o:p>
[SIZE=3][FONT=Arial]Private Sub Worksheet_Change(ByVal Target As Range)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Arial] Dim myRng As Range<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Arial] Set myRng = Me.Range("C3:C200")<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Arial] <o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Arial] If Intersect(myRng, Target.Cells) Is Nothing Then<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Arial] Exit Sub<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Arial] End If<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Arial] <o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Arial] Me.Parent.Save<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Arial] <o:p></o:p>[/FONT][/SIZE]
[FONT=Arial][SIZE=3]End Sub[/SIZE][/FONT]
[FONT=Arial][SIZE=3]
Module Code<o></o>
Code:
[/SIZE][/FONT]
[SIZE=3][FONT=Arial]Sub ConvertToUppercase()<o:p></o:p>[/FONT][/SIZE]
<o:p>[FONT=Arial][SIZE=3] [/SIZE][/FONT]</o:p>
[SIZE=3][FONT=Arial] Dim ws As Object<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Arial] Dim LCell As Range<o:p></o:p>[/FONT][/SIZE]
<o:p>[FONT=Arial][SIZE=3] [/SIZE][/FONT]</o:p>
[SIZE=3][FONT=Arial] 'Turn off screen updating to increase performance<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Arial] Application.ScreenUpdating = False<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Arial] Application.Calculation = xlCalculationManual<o:p></o:p>[/FONT][/SIZE]
<o:p>[FONT=Arial][SIZE=3] [/SIZE][/FONT]</o:p>
[SIZE=3][FONT=Arial] 'Move through each sheet in your spreadsheet<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Arial] For Each ws In ActiveWorkbook.Sheets<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Arial] On Error Resume Next<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Arial] ws.Activate<o:p></o:p>[/FONT][/SIZE]
<o:p>[FONT=Arial][SIZE=3] [/SIZE][/FONT]</o:p>
[SIZE=3][FONT=Arial] 'Convert all constants and text values to upper case<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Arial] For Each LCell In Cells.SpecialCells(xlConstants, xlTextValues)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Arial] LCell.Formula = UCase(LCell.Formula)<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Arial] Next<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Arial] Next ws<o:p></o:p>[/FONT][/SIZE]
<o:p>[FONT=Arial][SIZE=3] [/SIZE][/FONT]</o:p>
[SIZE=3][FONT=Arial] 'Turn screen updating back on<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Arial] Application.Calculation = xlCalculationAutomatic<o:p></o:p>[/FONT][/SIZE]
[SIZE=3][FONT=Arial] Application.ScreenUpdating = True<o:p></o:p>[/FONT][/SIZE]
<o:p>[FONT=Arial][SIZE=3] [/SIZE][/FONT]</o:p>
[FONT=Arial][SIZE=3]End Sub[/SIZE][/FONT]
[FONT=Arial][SIZE=3]
Thanking you in advance.
<o> </o>
Regards,
Dave T