+ Reply to Thread
Results 1 to 3 of 3

Modifying code for copying and pasting between sheets

  1. #1
    Registered User
    Join Date
    07-15-2008
    Location
    Philadelphia, Pa.
    Posts
    3

    Modifying code for copying and pasting between sheets

    Hi, and welcome to the forum.

    Please take a few moments to review the rules and guidance notes, particularly the requirement to make sure VBA code is placed between code tags, which makes it more readable. I've edited it for you on this occasion.

    The answer to your question is to use the VBA instruction Instr in your code. i.e.

    Please Login or Register  to view this content.
    The default result for a Range instruction is the Value of the range addresses, hence there's no need for .Value

    You will also speed up your macro if you do away with all the .Select instructions. There's no need for them. Just address the object directly and add the appropriate instruction. So instead of

    Please Login or Register  to view this content.

    Hello-

    I am working on a sheet where I want to copy and paste all rows within a column that contain the value ";" into another sheet. This code works if the cell value is equal to ";" alone but not if it's mixed with other characters. (ex: P330;P440). I think this is relatively simple to modify, but I am new to macros and can't figure it out. Here is the code (copied from another source and modified).........


    Please Login or Register  to view this content.

    Any help would be greatly appreciated. Thanks!

    john
    Last edited by Richard Buttrey; 07-15-2008 at 12:57 PM. Reason: Code tags missing.

  2. #2
    Registered User
    Join Date
    07-15-2008
    Location
    Philadelphia, Pa.
    Posts
    3

    still not working

    Thanks a lot for the suggestion. Apologies about the formatting. Seems like it's still not working though after I modified it. It gives me an error message that reads "Compile error: Syntax error." Any ideas what's wrong now? Here is the updated code....

    Please Login or Register  to view this content.
    Thanks, john

  3. #3
    Registered User
    Join Date
    07-15-2008
    Location
    Philadelphia, Pa.
    Posts
    3

    clarification

    To clarify further, this line comes up highlighted in red.........

    Please Login or Register  to view this content.

+ 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