+ Reply to Thread
Results 1 to 4 of 4

copy certain rows into columns

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-08-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    196

    copy certain rows into columns

    I am currently new in using excel VBA and require some assistance.
    I need help in creating a excel VBA macro which can extract specific ranges and paste it into a new column.

    I have following table (price – A column, cvr_price - B Column, price_type - C column) below:

    Price Cvr_Price Price Type
    99.945 CVR
    99.35 TALK
    99.32 CVR
    46a TALK
    99.21 TALK
    99.235 CVR
    100.226 CVR


    I would like to extract all the CVR’s prices and paste them into column B (Cvr_price).

    The output should look like the following below:
    Price Cvr_Price Price Type
    99.945 99.945 CVR
    99.35 TALK
    99.32 99.32 CVR
    46a TALK
    99.21 TALK
    99.235 99.235 CVR
    100.226 100.226 CVR

    I would like to know how can i do this using excel vba as I tried writing an if statement function but does not do what i want.

    If anyone could provide me with some assistant, i would be very grateful.

    Thank you.
    Last edited by missy22; 08-08-2012 at 07:10 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: copy certain rows into columns

    You do not need a macro for it.

    In cell B2, put this formula and then drag down -
    Formula: copy to clipboard
    =IF(C2="CVR",A2,"")
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Contributor
    Join Date
    08-08-2012
    Location
    london
    MS-Off Ver
    Excel 2010
    Posts
    196

    Re: copy certain rows into columns

    thank you so much for your help...i did not expect it would be so simple.

    thank you for your time and response.

    kind regards
    misbah

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: copy certain rows into columns

    Am glad it worked.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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