+ Reply to Thread
Results 1 to 7 of 7

If letter in cell then add row containing data from another sheet

  1. #1
    Registered User
    Join Date
    10-21-2013
    Location
    London England
    MS-Off Ver
    Excel 2010
    Posts
    3

    If letter in cell then add row containing data from another sheet

    Hello,

    I am an newbie starting to learn VBA. Really interested in certain problem, which is quite simple for you guys.

    Macro if cell contains letter "V" in certain range, then from data sheet row is copied and inserted to certain spot.


    Thank you for your time and effort

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: If letter in cell then add row containing data from another sheet

    Hi falco8. It would be helpful if we had a little more information. The best way to provide this information is if you could post a copy of your file with a detailed explanation of what you would like to do. For example, does the cell contain only the letter "V" or does it have other data in it, exactly what data do you wan to copy and exactly where do you want to insert it?

  3. #3
    Forum Contributor
    Join Date
    09-30-2013
    Location
    Toronto, ON
    MS-Off Ver
    Excel 2007
    Posts
    229

    Re: If letter in cell then add row containing data from another sheet

    Without more specifics I don't know that we can assist. Your code would look something like this.
    Please Login or Register  to view this content.
    There would need to be additional code to determine:
    • which row has the column V
    • which row/cols in the database need to be copied
    • which column you start pasting in

  4. #4
    Registered User
    Join Date
    10-21-2013
    Location
    London England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: If letter in cell then add row containing data from another sheet

    Thank you for response, I will make it now more specific:

    -Sheet1 has list, where "V" can be inserted Q2:Q36
    -IF Sheet1 list area has "V" in anyone of those cells Q2:Q36, then copy rows A2 A4 A13 form Sheet_Data to Sheet2 destination B3 and B14.

    Thats it,

    Thank you!

  5. #5
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: If letter in cell then add row containing data from another sheet

    Try:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    10-21-2013
    Location
    London England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: If letter in cell then add row containing data from another sheet

    Thank you Mumps1 for your effort, it works perfectly!

    If I wanted to separate range Q2:Q36, so the outcome would be different with each "V". Different rows will be copied from different locations. I would have to copy this code for example 36 times with different range(cell), or can code can be somehow shortened?

    "V" in Q2 means row3 from Sheet_data to Sheet2 row 4 and "V" in Q3 means row7 in Sheet_Data to Sheet2 row 5 and etc...

    Many thanks

  7. #7
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: If letter in cell then add row containing data from another sheet

    If you could attach a copy of the actual file you are using with a detailed explanation of what you would like to do, I'll be happy to have a look at it. Be sure to include what you want copied, the destination of the copied data and under which conditions you want that to happen.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 07-10-2012, 08:37 AM
  2. Replies: 2
    Last Post: 03-09-2011, 12:18 PM
  3. Replies: 17
    Last Post: 07-16-2009, 03:12 AM
  4. Replies: 2
    Last Post: 07-26-2005, 03:05 AM
  5. if a cell = a particular letter or even contains that letter
    By Brian in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-28-2005, 02:07 AM

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