S
STEVE BELL
First - thanks for any help.
Using XL 2000 on Win XP
I am using the following lines of code in 2 places in my workbook to
show and hide columns:
ThisWorkbook.Sheets(WSn).Range(Columns(1), Columns(col2 + 1)).Hidden = False
ThisWorkbook.Sheets(WSn).Range(Columns(2), Columns(col1)).Hidden = True <<<<
error 1004
In another module where I use the actual sheet name - it works fine.
ThisWorkbook.Sheets("Summary").Range(Columns(2), Columns(x)).Hidden = False
'some code
ThisWorkbook.Sheets("Summary").Range(Columns(2), Columns(col1)).Hidden =
True
But in this module where I am using a string variable for the sheet name
the second line errors out. (1004) I even copied the working code over and
changed
the sheet name to the variable.
Double checked the variable values and they appear to be reasonable
Can any body try to explain this to me...?
Thanks...
Using XL 2000 on Win XP
I am using the following lines of code in 2 places in my workbook to
show and hide columns:
ThisWorkbook.Sheets(WSn).Range(Columns(1), Columns(col2 + 1)).Hidden = False
ThisWorkbook.Sheets(WSn).Range(Columns(2), Columns(col1)).Hidden = True <<<<
error 1004
In another module where I use the actual sheet name - it works fine.
ThisWorkbook.Sheets("Summary").Range(Columns(2), Columns(x)).Hidden = False
'some code
ThisWorkbook.Sheets("Summary").Range(Columns(2), Columns(col1)).Hidden =
True
But in this module where I am using a string variable for the sheet name
the second line errors out. (1004) I even copied the working code over and
changed
the sheet name to the variable.
Double checked the variable values and they appear to be reasonable
Can any body try to explain this to me...?
Thanks...