Hello,
I'm having a small problem with part of a code - and just dont know why it isn't working when using Private Sub Workbook_Open() whereas it works when using commandbutton()!
the problem flags up on the penultimate line, and i just cant see a reason.
Please help!
All the best
I'm having a small problem with part of a code - and just dont know why it isn't working when using Private Sub Workbook_Open() whereas it works when using commandbutton()!
Private Sub Execute()
'Clear All Previous Data
With Sheets("Summary").Range("A3:K310")
.Interior.ColorIndex = none
.ClearContents
.MergeCells = False
End With
'Speeds up calculation by stopping certain Excel Actions
Application.ScreenUpdating = False
Application.DisplayStatusBar = True
Application.EnableEvents = False
'Recalculates Background
Worksheets("Plant_Bkgrd").Calculate
'TITLE & SUMMARY SETTINGS------------------------------------------------------------------------------------
'Title: Display Settings
Dim i As Integer 'Merge first columns
For i = 3 To 9
Sheets("Summary").Range(Cells(i, 2), Cells(i, 9)).MergeCells = True
Next i
'Clear All Previous Data
With Sheets("Summary").Range("A3:K310")
.Interior.ColorIndex = none
.ClearContents
.MergeCells = False
End With
'Speeds up calculation by stopping certain Excel Actions
Application.ScreenUpdating = False
Application.DisplayStatusBar = True
Application.EnableEvents = False
'Recalculates Background
Worksheets("Plant_Bkgrd").Calculate
'TITLE & SUMMARY SETTINGS------------------------------------------------------------------------------------
'Title: Display Settings
Dim i As Integer 'Merge first columns
For i = 3 To 9
Sheets("Summary").Range(Cells(i, 2), Cells(i, 9)).MergeCells = True
Next i
the problem flags up on the penultimate line, and i just cant see a reason.
Please help!
All the best