billyheanue
Board Regular
- Joined
- Jul 13, 2015
- Messages
- 109
Hi everyone. I have code that succeeds in expanding the current selection (CurrentRegion) to include one more column. It does that great. But when I added in lines (4) and (8), i get a error 404.
Heres what I got:
is something wrong with "Sheets(1).Rng.Copy" or "Sheets(1).CurrentSelection.PasteSpecial xlPasteFormats" ?
I am trying to copy the old formatting, and later paste it into the new selection once the current region has been expanded.
Thanks everyone,
Bill
Heres what I got:
Code:
Private Sub CommandButton3_Click()Set Rng = Range("L5").CurrentRegion
Rng.Select
Sheets(1).Rng.Copy
numRows = Selection.Rows.Count
numColumns = Selection.Columns.Count
Selection.resize(numRows + 0, numColumns + 1).Select
Sheets(1).CurrentSelection.PasteSpecial xlPasteFormats
End Sub
is something wrong with "Sheets(1).Rng.Copy" or "Sheets(1).CurrentSelection.PasteSpecial xlPasteFormats" ?
I am trying to copy the old formatting, and later paste it into the new selection once the current region has been expanded.
Thanks everyone,
Bill