I have this code that clears the contents in the first 28 columns in the active row. How can I include columns 95 to 107 (ignoring 29 - 94)
[VBA]ActiveCell.Resize(, 28).ClearContents[/VBA]
Printable View
I have this code that clears the contents in the first 28 columns in the active row. How can I include columns 95 to 107 (ignoring 29 - 94)
[VBA]ActiveCell.Resize(, 28).ClearContents[/VBA]
Not quite; it will only do this if the active cell is in column A, if the active cell is in any other column, the cells cleared will be the active cells and the 27 cells to the right of it.Quote:
Originally Posted by av8tordude
It might be safer to have:
[VBA]cells(activecell.row,"A").resize(,28).clearcontents[/VBA]
Perhaps by adding a second line:Quote:
Originally Posted by av8tordude
[VBA]cells(activecell.row,"A").offset(,94).resize(,13).clearcontents[/VBA]