Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Help with marco

i seen significant speed differences when running code after opening the vbe.
even if i close it, code runs slower. but if i quit , restart excel and then run
the code, it is fast again. open and close the code editor, it slows down.

--


Gary


"Scott_goddard" wrote in message
...
Below is a marco i have in a sheet. What i would like to do is add these
things, i am not sure where or how

No tick marks on the y 0r x axes,
between tick marks labels to be 1,
Back ground none
Vertical grid lines - max

Any help?


Sub MakeGanttChart()

Dim GanttChartRange As Range

'get to worksheet

ActiveSheet.Activate
Set StartCell = ActiveCell

'find the data range and assign it to GanttChartRange

Range("GanttAnchor").Select
TaskCount = 1

Do
ActiveCell.Offset(1, 0).Select
TaskCount = TaskCount + 1
Loop Until ActiveCell.Value = ""

Set GanttChartRange = Range("GanttAnchor").Offset(-1, 0).Resize(TaskCount, 4)

'Back to where we began

StartCell.Select

'Make and format Gantt Chart

Charts.Add
With ActiveChart
.ChartWizard Source:=GanttChartRange, Gallery:=xlBar, Format:=3,
PlotBy:=xlColumns, CategoryLabels:=1, SeriesLabels:=1, HasLegend:=1,
Title:=Title, CategoryTitle:="", ValueTitle:="", ExtraTitle:=""
.SeriesCollection(1).Border.LineStyle = xlNone
.SeriesCollection(1).Interior.ColorIndex = xlNone
.Axes(xlCategory).ReversePlotOrder = True
.Axes(xlCategory).Crosses = 4 'TaskCount
.Axes(xlValue).MinimumScale = GanttChartRange.Cells(1, 1).Value
.Axes(xlValue).TickLabels.Font.Name = "Arial"
.Axes(xlValue).TickLabels.Font.Size = 10
.Axes(xlCategory).TickLabels.Font.Name = "Arial"
.Axes(xlCategory).TickLabels.Font.Size = 10
.Legend.Font.Name = "Arial"
.Legend.Font.Size = 12
.HasTitle = True
.ChartTitle.Text = Range("GanttTitle").Value
.ChartTitle.Font.Name = "Arial"
.ChartTitle.Font.Size = 18
.ChartTitle.Font.Bold = False
End With

End Sub



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Help with marco

ignore, missed by one post

--


Gary


"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
i seen significant speed differences when running code after opening the vbe.
even if i close it, code runs slower. but if i quit , restart excel and then
run the code, it is fast again. open and close the code editor, it slows down.

--


Gary


"Scott_goddard" wrote in message
...
Below is a marco i have in a sheet. What i would like to do is add these
things, i am not sure where or how

No tick marks on the y 0r x axes,
between tick marks labels to be 1,
Back ground none
Vertical grid lines - max

Any help?


Sub MakeGanttChart()

Dim GanttChartRange As Range

'get to worksheet

ActiveSheet.Activate
Set StartCell = ActiveCell

'find the data range and assign it to GanttChartRange

Range("GanttAnchor").Select
TaskCount = 1

Do
ActiveCell.Offset(1, 0).Select
TaskCount = TaskCount + 1
Loop Until ActiveCell.Value = ""

Set GanttChartRange = Range("GanttAnchor").Offset(-1, 0).Resize(TaskCount, 4)

'Back to where we began

StartCell.Select

'Make and format Gantt Chart

Charts.Add
With ActiveChart
.ChartWizard Source:=GanttChartRange, Gallery:=xlBar, Format:=3,
PlotBy:=xlColumns, CategoryLabels:=1, SeriesLabels:=1, HasLegend:=1,
Title:=Title, CategoryTitle:="", ValueTitle:="", ExtraTitle:=""
.SeriesCollection(1).Border.LineStyle = xlNone
.SeriesCollection(1).Interior.ColorIndex = xlNone
.Axes(xlCategory).ReversePlotOrder = True
.Axes(xlCategory).Crosses = 4 'TaskCount
.Axes(xlValue).MinimumScale = GanttChartRange.Cells(1, 1).Value
.Axes(xlValue).TickLabels.Font.Name = "Arial"
.Axes(xlValue).TickLabels.Font.Size = 10
.Axes(xlCategory).TickLabels.Font.Name = "Arial"
.Axes(xlCategory).TickLabels.Font.Size = 10
.Legend.Font.Name = "Arial"
.Legend.Font.Size = 12
.HasTitle = True
.ChartTitle.Text = Range("GanttTitle").Value
.ChartTitle.Font.Name = "Arial"
.ChartTitle.Font.Size = 18
.ChartTitle.Font.Bold = False
End With

End Sub





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Marco Help looper Excel Discussion (Misc queries) 2 May 12th 07 06:55 PM
marco help mr1104839 Excel Programming 2 August 17th 06 05:42 PM
I need some help with a Marco xgunda420x Excel Discussion (Misc queries) 2 August 2nd 05 01:43 PM
Can it be done by marco? kaon[_5_] Excel Programming 1 June 28th 04 10:56 AM
marco David Kuehl Excel Programming 4 September 18th 03 11:37 PM


All times are GMT +1. The time now is 11:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"