Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9312933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T01:45:14+00:00 2026-06-19T01:45:14+00:00

My code is as follows. I have Rng set as a range in my

  • 0

My code is as follows. I have Rng set as a range in my looping macro, and this is a sub of that. If a certain condition is met, then the following sub is called:

Sub FKCutandPaste(Rng As Range)

Rng.Resize(, 9).Cut
Rng.Offset(, 19).Insert Shift:=xlDown
Rng.Resize(, 9).Delete Shift:=xlUp

I want this to cut out a section of the data, then paste it away from the active columns. However, the macro seems to just cut out the the required cells, but doesn’t move onto the second line.

Am I missing something very small here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T01:45:15+00:00Added an answer on June 19, 2026 at 1:45 am

    I can’t tell you if you have any specific problem. This code works fine for me, with an arbitrary sheet with data (and as its own sub), in Excel 2010:

    Sub test()
    Dim rng As Range
    Set rng = Cells(6, 2)
    rng.Resize(, 9).Cut
    rng.Offset(, 19).Select
    Selection.Insert Shift:=xlDown
    rng.Resize(, 9).Delete Shift:=xlUp
    End Sub
    

    I added the ‘select’ bit because that’s often helpful in testing – put a break on the select, run to it, then F8 the line; then see what’s selected. If it errors right there, then there’s something wrong with rng.offset(,19). If it succeeds and selects (something), then you can see where it thinks it should be inserting the data.

    Edit: Commenting out the rng.Resize(,9).Delete seems to fix the problem – it’s deleting the newly inserted cells. When you use rng.cut, and then paste the cells in, that seems to change the current location of rng. See this:

    Sub test()
    Dim rng As Range
    Set rng = Cells(6, 2)
    MsgBox (rng.Address)
    rng.Resize(, 9).Cut
    MsgBox (rng.Address)
    rng.Offset(, 19).Insert Shift:=xlDown
    MsgBox (rng.Address)
    rng.Resize(, 9).Delete Shift:=xlUp
    End Sub
    

    Change ‘cut’ to ‘copy’ and the behavior changes. You may want to simply do that – change it to copy – as you delete the original cells anyway.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The code that I have is as follows: <!DOCTYPE html> <html> <head> <script src=javascript/jquery.js
I have php code that puts some values into an Array as follows: $hunter=addslashes($MessageArray[1]);
I have a follows code that i have run on LinqPad: void Main() {
I have code as follows: $(#item_select).change(function() { var params = $(#item_select option:selected).val(); $.post('/account/ar_form.php', {idata:
I have a piece of javascript code as follows: var data = { ...
Currently, I have some code as follows template<typename Type> Type* getValue(std::string name, bool tryUseGetter
I have 3 different jquery uses & put it into one code as follows:
Suppose i have the code snippet as follows : ( clarification purpose/not well formed
I have menu bar and code is as follows <div style=background:#000; height: 25px;> <div
I have code to run sql query in ruby as follows sql = ActiveRecord::Base.connection()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.