+ Reply to Thread
Results 1 to 4 of 4

Help to modify a macro

  1. #1
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    521

    Help to modify a macro

    Dear Experts,
    I have a macro which copies information from column (Number specified in cell A1) of sheet1 and pastes it in column D of a new sheet(Sheet2) then it copies information from column ABC of sheet1 and pastes it in the column ABC of Sheet2. Again it takes information from Column E of sheet1 and pastes it under the last used cell of the column D goes back to sheet 1 gets the information from columns ABC and pastes it in sheet2 starting from first blank cell of column ABC Sheet2. So far its fine.
    Problem Starts when I have a value other than 4 (I want to use 5 and sometimes it can be 3 or 6 also) it picks up the correct information from specified column (2,3,4,5 or 6) and pastes it in the D column of the new sheet but for coping the constant columns it still picks up Column ABC and pastes it in sheet2 so when I use 5 in cell A1 information from column 4 is not copied and if I use 3 in cell a1 then again I have duplicate column D in sheet two
    Modification help that I am looking for is kind of relative reference to cell a1 where it not only starts coping information from specified column number but also moves from D to E of sheet2 if cell A1 reads 5 and also copies 4 columns.
    Attached, please find a sample sheet for which may give more clear picture.
    Current Code is
    Please Login or Register  to view this content.
    Best Regards/VKS
    Attached Files Attached Files

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,370

    Re: Help to modify a macro

    Hi VKS
    try it (see attachment)
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    11-11-2012
    Location
    Muscat, Oman
    MS-Off Ver
    Office 365
    Posts
    521

    Re: Help to modify a macro

    Dear nilem, attached, please find the output sheet that i get using your code.
    Best Regards/VKS
    Attached Files Attached Files

  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,370

    Re: Help to modify a macro

    There should be one blank row (#2) on a sheet "Input" macro to work correctly (see my previous file).
    Insert a blank line, and then try again.

+ 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