JSMITH242B
Programmer
I hope someone is able to help me out with this one..
Bit of background...I have 4 Excel Templates which I've formatted. I have formatted 3000 rows - not expecting more records than this for each one - validation is taken care of by the calling program. Headings and Columns are different in each template.
The 3001th row in each template is a summary/total of all the previous rows.
If there are only 10 records, I would like to suppress the extra rows..
I have the following code(snippet):
intRange = intRows + 6 'previous rows are headings
strRange = intRange & ":3000"
.deleteColumns srange - (calls the procedure below)
public Sub deleteColumns(srange)
'delete the range of columns selected
ExcelApp.Columns(srange).Select
ExcelApp.Selection.Delete 1
end sub
However when the deleteColumns is called, I receive a 'type mismatch' error.
On inspecting the intrange and strRange values, these are 'correct' based on the array being passed.
If I had 45 records, intRange is 51 -this is correct
strRange is 52:3000. This is the range I would like to delete.
I tried calling deleteColumns using the following:
deleteColumns "A1:B20" however, I still get the type mismatch error.
Any help much appreciated.
regards
J
Bit of background...I have 4 Excel Templates which I've formatted. I have formatted 3000 rows - not expecting more records than this for each one - validation is taken care of by the calling program. Headings and Columns are different in each template.
The 3001th row in each template is a summary/total of all the previous rows.
If there are only 10 records, I would like to suppress the extra rows..
I have the following code(snippet):
intRange = intRows + 6 'previous rows are headings
strRange = intRange & ":3000"
.deleteColumns srange - (calls the procedure below)
public Sub deleteColumns(srange)
'delete the range of columns selected
ExcelApp.Columns(srange).Select
ExcelApp.Selection.Delete 1
end sub
However when the deleteColumns is called, I receive a 'type mismatch' error.
On inspecting the intrange and strRange values, these are 'correct' based on the array being passed.
If I had 45 records, intRange is 51 -this is correct
strRange is 52:3000. This is the range I would like to delete.
I tried calling deleteColumns using the following:
deleteColumns "A1:B20" however, I still get the type mismatch error.
Any help much appreciated.
regards
J