+ Reply to Thread
Results 1 to 13 of 13

Copy Records where records = "a" at Column B - Syntax Error

  1. #1
    Forum Contributor
    Join Date
    09-01-2008
    Location
    Australia
    Posts
    108

    Copy Records where records = "a" at Column B - Syntax Error

    Hi All,
    I want to copy records where records = "a" at Column B. What's wrong with this syntax?

    Please Login or Register  to view this content.
    If on its own (without the copy), it is ok,

    Please Login or Register  to view this content.
    Regards,
    Nironto

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy Records where records = "a" at Column B - Syntax Error

    what are you trying to actually do?
    the syntax for copy is wrong

    expression .Copy(Destination)
    http://msdn.microsoft.com/en-us/libr.../ff837760.aspx
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Contributor
    Join Date
    09-01-2008
    Location
    Australia
    Posts
    108

    Re: Copy Records where records = "a" at Column B - Syntax Error

    Hi Humdingaling,
    I know is wrong. But I am trying to apply the same concept
    This is my original which works.

    Please Login or Register  to view this content.
    But I do not want to copy everything. I only want to copy those records where column B as "a'. ( a is used as tick)

    Regards,
    Nironto

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy Records where records = "a" at Column B - Syntax Error

    ok what do you do would you do with the copied data?
    are you keeping the same length/rows?

    you cant do it the way your thinking
    you could set up autofilter to copy range but your range will not be the same length anymore or you can create a loop to do one cell at time

    the autofilter method would be the way i would do it without VBA but can be replicated in VBA.
    Last edited by humdingaling; 07-11-2013 at 03:05 AM.

  5. #5
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy Records where records = "a" at Column B - Syntax Error

    Please Login or Register  to view this content.
    example of loop
    copies from Column B (2) to column D (4) anything that has "a"

  6. #6
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy Records where records = "a" at Column B - Syntax Error

    Please Login or Register  to view this content.
    if you want column D to only show A with no blanks

  7. #7
    Forum Contributor
    Join Date
    09-01-2008
    Location
    Australia
    Posts
    108

    Re: Copy Records where records = "a" at Column B - Syntax Error

    Hi Humdingaling,
    I appreciate your help.

    I attached an example of what I am trying to do.
    Copy Sheet1 records with 'X' to Sheet2.

    I am trying to skip Looping (Processing row by row) because there are 40k records.


    Regards,
    Nironto
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy Records where records = "a" at Column B - Syntax Error

    Try the attached
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    09-01-2008
    Location
    Australia
    Posts
    108

    Re: Copy Records where records = "a" at Column B - Syntax Error

    Thanks AB33!
    You are a genius!

    Regards,
    Nironto

  10. #10
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy Records where records = "a" at Column B - Syntax Error

    Nironto,
    You are welcome!

  11. #11
    Registered User
    Join Date
    09-07-2012
    Location
    southampton, england
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Copy Records where records = "a" at Column B - Syntax Error

    Hi All,

    This is very similar to something I am working on.

    I have uploaded the same file with the required output in sheet 2.

    If the cell is X select copy and paste adjacent cell.

    But

    If cell in next column is X copy and paste adjacent cell (same as before) into next column.

    Can anyone help?

    thanks Miles
    Attached Files Attached Files

  12. #12
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy Records where records = "a" at Column B - Syntax Error

    Miles,
    Welcome to the forum,
    You need to start your own thread as per forum's rule.

  13. #13
    Registered User
    Join Date
    09-07-2012
    Location
    southampton, england
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Copy Records where records = "a" at Column B - Syntax Error

    Sorry AB33,

    Have done: Titled the thread 'AB33 - loop copy paste to next column'

    http://www.excelforum.com/excel-gene...45#post3318345

    The real problem is here: Rota VBA - advice

    http://www.excelforum.com/excel-prog...ml#post3316328

    I was searching for similiar problems when I came across this thread..

+ 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