Re: VB CODE for moving the range of cells down by one row?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi again

Once your range is selected use this code to shift it one row down:

Selection.Cut Selection.Offset(1, 0)

Best regards,
Per

"CAPTGNVR" <CAPTGNVR@xxxxxxxxxxxxxxxxxxxxxxxxx> skrev i meddelelsen news:FF9E074A-5B1A-4BFA-A43A-40262EC12C5A@xxxxxxxxxxxxxxxx
GD EVE MARK, PER AND FST1

This given code ActiveCell.EntireRow.Insert shift:=xlDown
wont work for me bcos I want to only shift the range A30.K40, to A31. So I
dont want the activecell.entirerow.

So pleas suggest a solution to drag only the highlighted block A30.K40.
Once again what I actually need is the range is highlighted, point cursor on
the border and when u see four arrow click the mouse drag it one row below
and release.

Mr. Mark since u hv seen this program of mind and send a modified code, this
is for blocking a list of names, pull it down by a row without inserting
rows, to enter new crew names.

brgds/captgnvr


"Mark Ivey" wrote:

The following one-liner should shift your data down one row...
Put it in your code at the point you need the shift.


ActiveCell.EntireRow.Insert shift:=xlDown


Mark Ivey

"CAPTGNVR" <CAPTGNVR@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:47F9EC67-EE53-4AC8-AC16-A58E3B2E798A@xxxxxxxxxxxxxxxx
> DEAR ALL
>
> I have managed to get a range marked from active cell to the last row > of
> the
> data to colum K.
>
> Need to shift this whole range by one or two rows as required to insert
> fresh information. At least pls suggest how to shift the range by one
> row,
> which will also solve my data entry as I have to select the cell and > use a
> command button to shift the range by one cell each time.
>
> I can even high light how many rows i want to shift and get rows.count > and
> do, i guess but will first learn to shift by one row first.
>
> NOTE: cannot insert a new row bcos of hard coding in VB for copying > the
> values and pasting.
>
> Pls help.
>
> BRGDS/CAPTGNVR
>

.


Quantcast