largeselection
Active Member
- Joined
- Aug 4, 2008
- Messages
- 358
Just a quick one. How can I work with xltoright to fill a space beneath a row of data?
I have a column of formulas that I have copied and I need to just spread it as far to the right as the row of data directly above it.
Here's what I use to copy:
Selection.Copy
Range(Selection, Selection.Offset(795, 0)).Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.Copy
and then I had
Range(Selection, Selection.Offset(0, 100)).Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
to copy it to the right, but I'm finding that my data doesn't always have 100 columns and it can vary. So how can I add that? I thought maybe something with selecting a cell in that row then xltoright and then offsetting? but I'm not sure how I would work that into range (selection, selection) since I need to select the whole block.
I have a column of formulas that I have copied and I need to just spread it as far to the right as the row of data directly above it.
Here's what I use to copy:
Selection.Copy
Range(Selection, Selection.Offset(795, 0)).Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.Copy
and then I had
Range(Selection, Selection.Offset(0, 100)).Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
to copy it to the right, but I'm finding that my data doesn't always have 100 columns and it can vary. So how can I add that? I thought maybe something with selecting a cell in that row then xltoright and then offsetting? but I'm not sure how I would work that into range (selection, selection) since I need to select the whole block.