ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Funny macros (https://www.excelbanter.com/excel-programming/281815-funny-macros.html)

Phil Hageman[_3_]

Funny macros
 
These two macros are assigned to individual forms buttons
on various worksheets named "Customer" and "Metrics"

Sub GoToPPVChart()
Sheets("Metrics").Select
Range("A1").Select
With ActiveSheet.ChartObjects("Chart 13")
.Height = 660
.Width = 780
.Top = 10
.Left = 125
End With
End Sub

Sub GoToUtilizationChart()
Sheets("Metrics").Select
Range("A1").Select
With ActiveSheet.ChartObjects("Chart 17")
.Height = 660
.Width = 780
.Top = 10
.Left = 125
End With
End Sub

Chart names are correct, no error handling code.

Problem: Sub GoToUtilizationChart() works as instructed.
GoToPPVChart() does not make the chart visible on screen -
the Utilization chart continues to cover the PPV chart.

When I run the PPV macro I would like that chart to be on
top (visible) of the Utilization Chart.

How do I modify this code to bring this about?

Thanks, Phil


Tom Ogilvy

Funny macros
 
Sub GoToPPVChart()
Sheets("Metrics").Select
Range("A1").Select
With ActiveSheet.ChartObjects("Chart 13")
.Height = 660
.Width = 780
.Top = 10
.Left = 125
.BringtoFront
End With
End Sub

Sub GoToUtilizationChart()
Sheets("Metrics").Select
Range("A1").Select
With ActiveSheet.ChartObjects("Chart 17")
.Height = 660
.Width = 780
.Top = 10
.Left = 125
.BringtoFront
End With
End Sub

--
Regards,
Tom Ogilvy

"Phil Hageman" wrote in message
...
These two macros are assigned to individual forms buttons
on various worksheets named "Customer" and "Metrics"

Sub GoToPPVChart()
Sheets("Metrics").Select
Range("A1").Select
With ActiveSheet.ChartObjects("Chart 13")
.Height = 660
.Width = 780
.Top = 10
.Left = 125
End With
End Sub

Sub GoToUtilizationChart()
Sheets("Metrics").Select
Range("A1").Select
With ActiveSheet.ChartObjects("Chart 17")
.Height = 660
.Width = 780
.Top = 10
.Left = 125
End With
End Sub

Chart names are correct, no error handling code.

Problem: Sub GoToUtilizationChart() works as instructed.
GoToPPVChart() does not make the chart visible on screen -
the Utilization chart continues to cover the PPV chart.

When I run the PPV macro I would like that chart to be on
top (visible) of the Utilization Chart.

How do I modify this code to bring this about?

Thanks, Phil





All times are GMT +1. The time now is 06:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com