LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default running change events to macros

hi i'm new to vba and i'm struggling with this problem.
i have 2 event programs which i wish to convert to macros so i can use an
event procedure to run these macros along with 2 others in order below is the
code for the event programs i wish to change.

the first one changes all lower case to upper case

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then
Exit Sub
End If
On Error GoTo ErrHandler:
If Not Application.Intersect(Me.Range("C5:AG13"), Target) Is Nothing Then
If IsNumeric(Target.Value) = False Then
Application.EnableEvents = False
'Target.Value = StrConv(Target.Text, vbLowerCase)
Target.Value = StrConv(Target.Text, vbUpperCase)
'Target.Value = StrConv(Target.Text, vbProperCase)
Application.EnableEvents = True
End If
End If
ErrHandler:
Application.EnableEvents = True
End Sub

this one copies a named range when a change is initiated then copies it to a
master worksheet with a similar named range.

Sub worksheet_change(ByVal target As Range)

For Dept = 1 To 3 Step 2
For MonthNum = 1 To 12
RangeName = MonthName(MonthNum, True) & "d" & Dept
If Not Intersect(target, Range(RangeName)) Is Nothing Then
DestRangeName = Dept & "d" & MonthName(MonthNum, True)
Range(RangeName).Copy _
Destination:=Sheets("Master Roster").Range(DestRangeName)
Exit Sub
End If
Next MonthNum
Next Dept
End Sub

the other 2 macros are for changing the cell interior colours when a set
condition is met.

your help in this problem is very much appreciated
thank you


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
using mouse click events in macros spgandau Excel Programming 3 April 12th 08 02:40 PM
combobox change event is running when enable events is false tysop Excel Programming 3 January 24th 06 02:16 PM
Running procedures on events xl2003 ragtop73 Excel Programming 2 December 14th 05 02:25 PM
Running Excel events even in edit mode.... Ishika Excel Discussion (Misc queries) 0 June 16th 05 06:53 PM
disable events while macro is running ben Excel Programming 5 January 24th 05 05:19 PM


All times are GMT +1. The time now is 06:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"