A
Atishoo
Im having trouble with very slow code execution on even some basic code are
freezing at "end with" at the end of the code
eg this sub for clearing the contents of an offset cell to the active cell.
Private Sub CommandButton28_Click()
With Worksheets("Main Board")
c = .Range("D82").Value
ActiveCell.Offset(c, 0) = " "
End With
End Sub
the only other sub that might run at the same time is a selection change sub
that is large and planning on becoming much larger, is there a way of
simplifying this to make it run quicker?
this sub brings the appropriate combo box into view close to the active cell
dependent on the range it falls within.
As you can see I have just piled one "with ... end with" ontop of another Im
thinking there may be a way of integrating this into one.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With ActiveSheet.ComboBox56
If Not Intersect(Target, Range("alertslist")) Is Nothing Then
.Visible = True
.Top = Target.Top + Target.Cells.Height
.Left = Target.Left
Else
.Visible = False
End If
End With
With ActiveSheet.ComboBox61
If Not Intersect(Target, Range("monworkers")) Is Nothing Then
.Visible = True
.Top = Target.Top + Target.Cells.Height
.Left = Target.Left
Else
.Visible = False
End If
End With
With ActiveSheet.ComboBox60
If Not Intersect(Target, Range("tueworkers")) Is Nothing Then
.Visible = True
.Top = Target.Top + Target.Cells.Height
.Left = Target.Left
Else
.Visible = False
End If
End With
End Sub
freezing at "end with" at the end of the code
eg this sub for clearing the contents of an offset cell to the active cell.
Private Sub CommandButton28_Click()
With Worksheets("Main Board")
c = .Range("D82").Value
ActiveCell.Offset(c, 0) = " "
End With
End Sub
the only other sub that might run at the same time is a selection change sub
that is large and planning on becoming much larger, is there a way of
simplifying this to make it run quicker?
this sub brings the appropriate combo box into view close to the active cell
dependent on the range it falls within.
As you can see I have just piled one "with ... end with" ontop of another Im
thinking there may be a way of integrating this into one.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With ActiveSheet.ComboBox56
If Not Intersect(Target, Range("alertslist")) Is Nothing Then
.Visible = True
.Top = Target.Top + Target.Cells.Height
.Left = Target.Left
Else
.Visible = False
End If
End With
With ActiveSheet.ComboBox61
If Not Intersect(Target, Range("monworkers")) Is Nothing Then
.Visible = True
.Top = Target.Top + Target.Cells.Height
.Left = Target.Left
Else
.Visible = False
End If
End With
With ActiveSheet.ComboBox60
If Not Intersect(Target, Range("tueworkers")) Is Nothing Then
.Visible = True
.Top = Target.Top + Target.Cells.Height
.Left = Target.Left
Else
.Visible = False
End If
End With
End Sub