I would like to set a range to fit width columns, but I would like to set using numbers, no letters, something like this:
myWorksheet.Range(Cells(1, 1), Cells(1, 13)).Columns.AutoFit
But I get an error 400.
If I use
myWorksheet.Range("A1:M1").Columns.AutoFit
It works perfecly.
How I could to use cells to set the range and to do the AutoFit? Because I am using variables to set the range and I can't use letters, I have to use the numbers.
Thanks.