D
DAVEYB
I am new to coding and am getting the Compile error message - procedure too
large.
Can anyone advise me how to consense the following code based on a combi box
allowing the user to select a month ?
It is 57 pages long but an extract appears below.
Private Sub ComboBox1_Change()
Columns("A:IV").EntireColumn.Hidden = False
If ComboBox1 = "JANUARY" Then
Columns("O:X").EntireColumn.Hidden = True
Columns("AP:AX").EntireColumn.Hidden = True
Columns("Z:AA").EntireColumn.Hidden = True
Columns("AZ:BA").EntireColumn.Hidden = True
Range("AB15").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-23]:RC[-14])"
Range("AB16").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-23]:RC[-14])"
Range("AB17").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-23]:RC[-14])"
Range("AB18").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-23]:RC[-14])"
Many thanks
Dave
large.
Can anyone advise me how to consense the following code based on a combi box
allowing the user to select a month ?
It is 57 pages long but an extract appears below.
Private Sub ComboBox1_Change()
Columns("A:IV").EntireColumn.Hidden = False
If ComboBox1 = "JANUARY" Then
Columns("O:X").EntireColumn.Hidden = True
Columns("AP:AX").EntireColumn.Hidden = True
Columns("Z:AA").EntireColumn.Hidden = True
Columns("AZ:BA").EntireColumn.Hidden = True
Range("AB15").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-23]:RC[-14])"
Range("AB16").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-23]:RC[-14])"
Range("AB17").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-23]:RC[-14])"
Range("AB18").Select
ActiveCell.FormulaR1C1 = "=SUM(RC[-23]:RC[-14])"
Many thanks
Dave