Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
using mouse click events in macros | Excel Programming | |||
combobox change event is running when enable events is false | Excel Programming | |||
Running procedures on events xl2003 | Excel Programming | |||
Running Excel events even in edit mode.... | Excel Discussion (Misc queries) | |||
disable events while macro is running | Excel Programming |