Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have been slowly adding to the following procedure and now it runs real
slow. Is there a better way to write it to speed it up? Sub addestimateitem() Dim cboxno, itemno As Integer unprotectsheet itemno = ActiveSheet.Range("estitemnum") + 1 Range("estitemnum").Value = itemno cboxno = ActiveSheet.Range("estcboxnum") + 1 Range("estcboxnum").Value = cboxno Range("esttotal").Select ActiveCell.Offset(itemno, 0).Name = "esttotalamt" Range("estno").Select ActiveCell.Offset(itemno, 0).Select Selection.EntireRow.Insert ActiveCell.Value = itemno Range(ActiveCell.Offset(0, 2), ActiveCell.Offset(0, 4)).Select mergecells Range(ActiveCell.Offset(0, 1), ActiveCell.Offset(0, 3)).Select mergecells ActiveCell.EntireRow.Cells(13).Value = cboxno ActiveCell.Offset(0, -5).Select Selection.RowHeight = 12.75 Selection.Font.Bold = False Selection.Font.Size = 10 Range(ActiveCell.Offset(0, 0), ActiveCell.Offset(0, 9)).Select addborders ActiveCell.Offset(0, 1).Select Selection.Borders(xlEdgeRight).LineStyle = xlNone Range(ActiveCell.Offset(0, 1), ActiveCell.Offset(0, 7)).Select Selection.Locked = False Range(ActiveCell.Offset(0, 4), ActiveCell.Offset(0, 5)).Select Selection.NumberFormat = "$#,##0.00_);[Red]($#,##0.00)" With Selection.Font .Name = "Arial" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic End With ActiveCell.Offset(0, 1).Select ActiveCell.FormulaR1C1 = "=IF(RC[2],RC[-1],0)" ActiveCell.Offset(0, -8).Select addcheckbox Range("esttotal").Select Range(ActiveCell.Offset(1, 0), ActiveCell.Offset(itemno, 0)).Select Selection.Name = "esttotalscol" Range("esttotalamt").Select Selection.NumberFormat = "$#,##0.00_);[Red]($#,##0.00)" With Selection.Font .Name = "Arial" .FontStyle = "Bold" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic End With ActiveCell.FormulaR1C1 = "=sum(esttotalscol)" Range("estsubven").Select ActiveCell.Offset(itemno, 0).Select protectsheet End Sub Thank You |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Stop a Procedure from another procedure | Excel Discussion (Misc queries) | |||
Slow Excel Navigation with Up / Down Arrow and slow scrolling | Excel Discussion (Misc queries) | |||
How to jump from a Form procedure to a Workbook or Module procedure? | Excel Programming | |||
Calling a procedure in a procedure | Excel Programming |