+ Reply to Thread
Results 1 to 3 of 3

the code don't work

  1. #1
    Registered User
    Join Date
    02-23-2015
    Location
    hk
    MS-Off Ver
    window7
    Posts
    240

    the code don't work

    The follow code don’t work.

    Public Sub CopyRows()
    Sheets("Sheet1").Select

    For x = 2 To 200

    ThisValue = Cells(x, 5).Value
    If ThisValue = "1" Then
    Cells(x, 5).Resize(15, 25).Copy
    Sheets("Sheet2").Select
    NextRow = Cells(Rows.Count, 1).End(xlUp).Row + 1
    Cells(NextRow, 1).Select
    ActiveSheet.Paste
    Sheets("Sheet1").Select

    End If
    Next x
    End Sub


    We have sheet 1 of A file and would like to move required information to sheet 2 of A file . The final result should same as Named Move file sheet2. We should move the result (column f=1) to sheet 2,
    if group=1(column p=1),paste A2,A3….
    if group=2(column p=2), paste A22,A23…..
    if group=3(column p=3),paste A32,A33….

    The code should be?

    Tks
    Tom
    Attached Files Attached Files

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: the code don't work

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: the code don't work

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

+ 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. VBA Code for populating cells from one Work Book A to another Work Book with condition
    By ray.kanata in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 06-22-2015, 03:46 PM
  2. Cannot get the SQL code to work inside VBA code
    By eastgoddes in forum Access Tables & Databases
    Replies: 1
    Last Post: 02-17-2014, 08:44 AM
  3. Replies: 9
    Last Post: 08-30-2013, 07:49 AM
  4. Replies: 1
    Last Post: 08-14-2013, 12:01 PM
  5. [SOLVED] hELP FOR MY PROJECT (IN PROJECT SHEET CODE NOT WORK,, OUTSIDE THAT CODE WORK)
    By santosh226001 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 08-06-2013, 06:53 AM
  6. Code to work at the same time as other code???
    By D_N_L in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-15-2012, 12:43 PM

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