Yes of course perhaps like this i.e. change line
to
I used the Trim command as I found out that the label is not "Total" but "Total " and this makes a difference but the Trim command gets rid of the extra space at the end. You can see the extra space if you select cell E3 or E14 and press the F2 button on the keyboard.
The Offset command takes two values i.e. row offset and column offset. These values can be negative or positive depending on their position.
If for example the E column is the one you use for finding the value "Total" and the wish to copy the range from C column to K column the range to copy the size of the range is Range(cell.Offset(0, -2), cell(0, 6)) i.e. same row as your E value Offset(0, and 2 column to the left of the E column gives cell.offset(0, -2) and the second cell has a row offset of 0 and a column offset of 6 i.e. cell.Offset(0, 6)
So if you wish to copy all the way to the Y column you need to change the last cell offset from cell.Offset(0, 6) to cell.Offset(0, 20)
Alf
Ps If you are happy with my answers you could click on the small star (bottom left in my post) and give a rating to my help.
Bookmarks