Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I have compiled this makro. But the error message
is:Compile error invalid or unqualified reference and CheckBoxes is highlighted. Please help. If .CheckBoxes(46).Checked = True Then Range("O54").Select ActiveCell.FormulaR1C1 = "50000" Range("T54").Select ActiveCell.FormulaR1C1 = "4000" Range("Y54").Select ActiveCell.FormulaR1C1 = "4000" Range("AD54").Select ActiveCell.FormulaR1C1 = "4000" Range("AI54").Select ActiveCell.FormulaR1C1 = "4000" Range("AN54").Select ActiveCell.FormulaR1C1 = "4000" Range("AS54").Select ActiveCell.FormulaR1C1 = "4000" Range("AX54").Select ActiveCell.FormulaR1C1 = "4000" Range("BC54").Select ActiveCell.FormulaR1C1 = "4000" Range("BH54").Select ActiveCell.FormulaR1C1 = "4000" Range("O78").Select ActiveCell.FormulaR1C1 = "120000" Range("O78").Select ActiveSheet.Shapes.AddShape (msoShapeRectangularCallout, 629.25, 643.5, 51#, _ 30.75).Select Selection.Characters.Text = "Japan" With Selection.Characters(Start:=1, Length:=5).Font .Name = "Arial" .FontStyle = "Regular" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic End With Selection.ShapeRange.Adjustments.Item(1) = -0.1618 Selection.ShapeRange.Adjustments.Item(2) = 1.1219 Selection.ShapeRange.ScaleHeight 0.56, msoFalse, msoScaleFromTopLeft Range("O77").Select ActiveWindow.SmallScroll Down:=-60 If .CheckBoxes(46).Unchecked = False Then Range("O78").Select Selection.ClearContents ActiveSheet.Shapes("AutoShape 44").Select Selection.Delete ActiveWindow.SmallScroll Down:=-15 Range("O54:BH54").Select Selection.ClearContents Range("A5").Select End Sub |
#2
![]() |
|||
|
|||
![]()
If CheckBoxes(46).Value Then
(not .checked) Also -- remove all those Selects and ActiveCell... combine them like Range("O54").FormulaR1C1="50000" Range ("T54").FormulaR1C1="4000" etc. Better yet, use Range("O54").Value=50000 Range("T54"),Value=4000 etc. Bob Umlas Excel MVP "es" wrote in message ... I have compiled this makro. But the error message is:Compile error invalid or unqualified reference and CheckBoxes is highlighted. Please help. If .CheckBoxes(46).Checked = True Then Range("O54").Select ActiveCell.FormulaR1C1 = "50000" Range("T54").Select ActiveCell.FormulaR1C1 = "4000" Range("Y54").Select ActiveCell.FormulaR1C1 = "4000" Range("AD54").Select ActiveCell.FormulaR1C1 = "4000" Range("AI54").Select ActiveCell.FormulaR1C1 = "4000" Range("AN54").Select ActiveCell.FormulaR1C1 = "4000" Range("AS54").Select ActiveCell.FormulaR1C1 = "4000" Range("AX54").Select ActiveCell.FormulaR1C1 = "4000" Range("BC54").Select ActiveCell.FormulaR1C1 = "4000" Range("BH54").Select ActiveCell.FormulaR1C1 = "4000" Range("O78").Select ActiveCell.FormulaR1C1 = "120000" Range("O78").Select ActiveSheet.Shapes.AddShape (msoShapeRectangularCallout, 629.25, 643.5, 51#, _ 30.75).Select Selection.Characters.Text = "Japan" With Selection.Characters(Start:=1, Length:=5).Font .Name = "Arial" .FontStyle = "Regular" .Size = 10 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = xlAutomatic End With Selection.ShapeRange.Adjustments.Item(1) = -0.1618 Selection.ShapeRange.Adjustments.Item(2) = 1.1219 Selection.ShapeRange.ScaleHeight 0.56, msoFalse, msoScaleFromTopLeft Range("O77").Select ActiveWindow.SmallScroll Down:=-60 If .CheckBoxes(46).Unchecked = False Then Range("O78").Select Selection.ClearContents ActiveSheet.Shapes("AutoShape 44").Select Selection.Delete ActiveWindow.SmallScroll Down:=-15 Range("O54:BH54").Select Selection.ClearContents Range("A5").Select End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) | |||
automatic macro update | Excel Worksheet Functions | |||
Date macro | Excel Discussion (Misc queries) | |||
Macro and If Statement | Excel Discussion (Misc queries) | |||
Macro Formula revision? | Excel Worksheet Functions |