+ Reply to Thread
Results 1 to 5 of 5

Copy/Cut and paste in the same sheet

  1. #1
    Registered User
    Join Date
    07-30-2009
    Location
    Mumbai
    MS-Off Ver
    Excel 2003
    Posts
    6

    Copy/Cut and paste in the same sheet

    Hello,

    In the attached i have 2 sheets in sheet bf is how the data is and in sheet af is how the data has to look.

    I am looking for a code to copy/cut and paste in the same sheet.

    Instance 1
    Copy I2:U2 and paste it at I9:U9 and delete I2:U2 or cut instead of copy
    same way I3:U4 and paste I11:U12 and delete I3:U4 or cut instead of copy
    Copy I7:U7 and paste I13:U13 and delete I7:U7 or cut instead of copy

    the blank row between the 2 instances can variate from 1 row to 4-5 rows also
    the headers in column H are constant for each instance.

    Can any 1 help me as i have multiple sheets running down till row 2500+

    Thanks,

    Satyam
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy/Cut and paste in the same sheet

    This macro will do the reset for you. Try it on a copy of your longer sheet.
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    07-30-2009
    Location
    Mumbai
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Copy/Cut and paste in the same sheet

    Thank you very much, this works the way i want except for the below

    .Range("I" & vRow + 11).Resize(2, 13).Value = _
    .Range("I" & vRow + 5).Resize(2, 13).Value

    I have updated to

    .Range("I" & vRow + 11).Resize(, 13).Value = _
    .Range("I" & vRow + 5).Resize(, 13).Value

    and

    .Range("I" & vRow + 5).Resize(2, 13).Value = ""
    to
    .Range("I" & vRow + 5).Resize(, 13).Value = ""

    before i update this post to solved one more help, prior to running this macro if i have to insert 3 rows at every instance and update their headers in Column H, in the earlier attachment say row 11-13 and column H to be updated with the mentioned headers can this be possible in the same macro and can you help me add in the current macro.

    Satyam

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copy/Cut and paste in the same sheet

    What mentioned headers? Your first question was very precise and included an example workbook. Why not do the same here?

  5. #5
    Registered User
    Join Date
    07-30-2009
    Location
    Mumbai
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Copy/Cut and paste in the same sheet

    In the attached insert 3 rows after row 10, row 20 and then after row 34
    In row 10 insert formula
    I10 =SUM(I11:I12) this formula to be inserted in I10 till U10
    H11 "LY POS Units Sold"
    H12 "LY S/R Units Sold"
    H13 "LY Stock Shipments"
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1