All of the Active X codes seem to work with the "step through" (F8) but all of the other vba code will not allow me to use that function?? I have looked through google and the best I can come up with is there might be something running in the background. Please help me - the problem seems to be in all of my other workbooks as well.
I have attached the most recent code i have been working on below.
Option Explicit
Private Sub CommandButton1_Click()
ActiveSheet.PageSetup.PrintArea = "$B$2:$M$86"
Application.Dialogs(xlDialogPrint).Show 'Printer manually select.("Adobe PDF")
'End SubPrivate Sub Worksheet_Change(ByVal Target As Range)
'Dim KeyCells As Range
'Set KeyCells = Range("E23")
'If Not Application.Intersect(KeyCells, Range(Target.Address)) _
'Is Nothing Then
'End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
' The variable KeyCells contains the cells that will
' cause an alert when they are changed.
Set KeyCells = Range("F48")
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
' Place your code here.
Application.EnableCancelKey = xlDisabled
End If
5 Application.ScreenUpdating = False
'Range("E27:G27").ClearContents
If ActiveSheet.Range("F48") = "MSTC-16" Then GoTo 10
If ActiveSheet.Range("F48") = 2 Then GoTo 20
'PUTS Single Stud Elevation Diagram In
10 If ActiveSheet.Range("F48") = "MSTC-16" Then
ActiveSheet.Shapes("Group New").Delete
ActiveSheet.Shapes("Group 4156").Select
Selection.Copy
Range("C52").Select
Application.DisplayAlerts = False
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Name = "Group New"
End If
'PUTS 2 Studs Elevation Diagram In
20 If ActiveSheet.Range("E19") = "2" Then
ActiveSheet.Shapes("Group New").Delete
ActiveSheet.Shapes("Group 1039").Select
Selection.Copy
Range("C33").Select
Application.DisplayAlerts = False
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Name = "Group New"
End If
Application.ScreenUpdating = True
End Sub
I have attached the most recent code i have been working on below.
Option Explicit
Private Sub CommandButton1_Click()
ActiveSheet.PageSetup.PrintArea = "$B$2:$M$86"
Application.Dialogs(xlDialogPrint).Show 'Printer manually select.("Adobe PDF")
'End SubPrivate Sub Worksheet_Change(ByVal Target As Range)
'Dim KeyCells As Range
'Set KeyCells = Range("E23")
'If Not Application.Intersect(KeyCells, Range(Target.Address)) _
'Is Nothing Then
'End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
' The variable KeyCells contains the cells that will
' cause an alert when they are changed.
Set KeyCells = Range("F48")
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
' Place your code here.
Application.EnableCancelKey = xlDisabled
End If
5 Application.ScreenUpdating = False
'Range("E27:G27").ClearContents
If ActiveSheet.Range("F48") = "MSTC-16" Then GoTo 10
If ActiveSheet.Range("F48") = 2 Then GoTo 20
'PUTS Single Stud Elevation Diagram In
10 If ActiveSheet.Range("F48") = "MSTC-16" Then
ActiveSheet.Shapes("Group New").Delete
ActiveSheet.Shapes("Group 4156").Select
Selection.Copy
Range("C52").Select
Application.DisplayAlerts = False
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Name = "Group New"
End If
'PUTS 2 Studs Elevation Diagram In
20 If ActiveSheet.Range("E19") = "2" Then
ActiveSheet.Shapes("Group New").Delete
ActiveSheet.Shapes("Group 1039").Select
Selection.Copy
Range("C33").Select
Application.DisplayAlerts = False
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.Name = "Group New"
End If
Application.ScreenUpdating = True
End Sub