Help w/VBA object interferring with Macro

Drewbert34

New Member
Joined
Jun 21, 2011
Messages
26
I'm pretty new at VBA coding and verbiage so I hope I'm describing this so that it is understood by those more familiar with this than I.

I have this VBA coding that will date stamp column B if any changes are made in the range.

"Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range
For Each cell In Target
If Not Intersect(cell, Range("A:BV")) Is Nothing Then
If cell <> "" Then
Application.EnableEvents = False
Range("B" & cell.Row) = Date
Application.EnableEvents = True
End If
End If
Next cell
End Sub"

Then I have 2 Macros that I need to run every Friday to format my workbook to remove Green highlighting and Bold font as well as devalue vlookups and certain formulas from my sheet.

"Sub RemoveGreenBold1()
'
' RemoveGreenBold1 Macro
'
'
Range("A7:BV7", Range("A7:BV7").End(xlDown)).Select
Selection.Font.Bold = False
ActiveSheet.Range("$A$6:$BV$313").AutoFilter Field:=1, Criteria1:=RGB(191, _
191, 191), Operator:=xlFilterCellColor
Range("B7:BV7", Range("B7:BV7").End(xlDown)).Select
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
ActiveSheet.Range("$A$6:$BV$456").AutoFilter Field:=1
End Sub"

and...

"Sub CopyPasteSpecial1()
'
' CopyPasteSpecial1 Macro
'
' Keyboard Shortcut: Ctrl+y
'
ActiveSheet.Range("$A$6:$BU$456").AutoFilter Field:=1, Criteria1:="<>"
Range("D7:F7").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Range("H7:Z7").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
ActiveWindow.SmallScroll Down:=-453
Range("I7:Z7").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Range("AM7").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Range("AP7:AT7").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Range("AV7:AW7").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Range("BD7").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
Range("BM7").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
ActiveSheet.Range("$A$6:$BU$620").AutoFilter Field:=1
ActiveWindow.SmallScroll Down:=-15
ActiveSheet.Shapes("Button 1").Visible = False
ActiveSheet.Shapes("Button 2").Visible = False
Range("a2") = Sheet1.Range("a2") + 7
End Sub"

The issue is that when the 2 Macros run they cause the VBA object to change the date in column B. How do I tell the Macros to diable the VBA object only while running the Macros?
 
Just so that I understand correctly. I would need to separate out each row individually? I guess length of the Macro is not necessarily indicative of the speed at which it runs?

I will do a search on the screen updating on/off. Thank you for the tip! I need all the help I can get...but I am learning!

Once again thank you for your time!

I meant to say seperate out each column seperately. My apologies.
 
Upvote 0

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Forum statistics

Threads
1,224,583
Messages
6,179,681
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top