C
cb95amc
I have a file I created in Excel 2003, but in Excel 2000 when some of
the macros are run they give a Debug error....However, when you open
the debug window the line of code being referred to is in a different
macro to the on that should be running....
For example - On one sheet I have a combo box and a couple of command
buttons....In Excel 2003 everything works as it should....
However, in Excel 2000 the combo box works fine, but when you click
either of the command buttons it gives the following
run time error '1004' -Select Method of Range class failed
When you hit debug the line that is highlighted is in the CombBox
macro...The "Columns("D:AX").Select" line shown below.
All was well with the file a week ago, and I haven't changed any of
the macro code since then.....
Macros are shown below....
Private Sub ComboBox1_Change()
If Range("A5").Value = "Market" Then
HIDEALL
Columns("D:AX").Select
Selection.EntireColumn.Hidden = False
Columns("U:AK").Select
Selection.EntireColumn.Hidden = True
Application.Goto Reference:="R52C4"
Application.Goto Selection, True
End If
End Sub
Private Sub CommandButton1_Click()
ActiveSheet.Calculate
End Sub
Private Sub CommandButton3_Click()
With Columns("U:AK")
.Hidden = Not .Hidden
End With
ActiveSheet.Calculate
End Sub
Any suggestions...
Thanks
Andy
the macros are run they give a Debug error....However, when you open
the debug window the line of code being referred to is in a different
macro to the on that should be running....
For example - On one sheet I have a combo box and a couple of command
buttons....In Excel 2003 everything works as it should....
However, in Excel 2000 the combo box works fine, but when you click
either of the command buttons it gives the following
run time error '1004' -Select Method of Range class failed
When you hit debug the line that is highlighted is in the CombBox
macro...The "Columns("D:AX").Select" line shown below.
All was well with the file a week ago, and I haven't changed any of
the macro code since then.....
Macros are shown below....
Private Sub ComboBox1_Change()
If Range("A5").Value = "Market" Then
HIDEALL
Columns("D:AX").Select
Selection.EntireColumn.Hidden = False
Columns("U:AK").Select
Selection.EntireColumn.Hidden = True
Application.Goto Reference:="R52C4"
Application.Goto Selection, True
End If
End Sub
Private Sub CommandButton1_Click()
ActiveSheet.Calculate
End Sub
Private Sub CommandButton3_Click()
With Columns("U:AK")
.Hidden = Not .Hidden
End With
ActiveSheet.Calculate
End Sub
Any suggestions...
Thanks
Andy