+ Reply to Thread
Results 1 to 8 of 8

how to transfer certain cells from sheet1 to sheet2

  1. #1
    Registered User
    Join Date
    05-25-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    11

    Smile how to transfer certain cells from sheet1 to sheet2

    Hi,

    I am trying to do somekind of sorting?
    if the first character of the cell is number or * then copy that cell(row i ) and the cell above(row i -1) to sheet2.
    I am not sure how to check the first character is *.


    The idea is this:

    Please Login or Register  to view this content.
    Any help would be appreciated,
    Thanks
    Last edited by FDibbins; 12-15-2013 at 10:42 PM. Reason: Code tags added

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: how to transfer certain cells from sheet1 to sheet2

    may be this.....

    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: how to transfer certain cells from sheet1 to sheet2

    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

    I have added them for you - this time
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    05-25-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: how to transfer certain cells from sheet1 to sheet2

    I modified my code to :
    Please Login or Register  to view this content.
    And I am getting a subscript out of range error.
    how can I cease this error?
    Last edited by lee478; 12-16-2013 at 12:04 AM.

  5. #5
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: how to transfer certain cells from sheet1 to sheet2

    in the line

    Please Login or Register  to view this content.
    if the loop starts from i=1, ws1.cells(i-1,1) becomes ws1.cells(0,1) which is wrong because there is no row 0.

  6. #6
    Registered User
    Join Date
    05-25-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: how to transfer certain cells from sheet1 to sheet2

    Please Login or Register  to view this content.
    I changed to this but I dont think this is the problem?
    debugger highlights the following line:
    Please Login or Register  to view this content.

  7. #7
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: how to transfer certain cells from sheet1 to sheet2

    Delete the sheet added (Output) before running the code again. Check the error msg also...what that error msg. says?

  8. #8
    Registered User
    Join Date
    05-25-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: how to transfer certain cells from sheet1 to sheet2

    you mean this?

    Please Login or Register  to view this content.
    Same error "subscript out of range"

+ 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. transfer of value from sheet1 to sheet2
    By ajithegreat in forum Excel General
    Replies: 2
    Last Post: 09-25-2013, 05:24 AM
  2. I want to transfer data from SHEET1 to SHEET2
    By hesham63 in forum Excel General
    Replies: 4
    Last Post: 07-30-2011, 12:28 PM
  3. Sheet1 & Sheet2 transfer
    By ersoyalanprovus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-07-2009, 09:05 AM
  4. Transfer data from sheet1 to sheet2 and sheet3
    By vbosmiya in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-21-2007, 11:42 PM
  5. Transfer data from sheet1 to sheet2
    By Tommy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-11-2005, 02:06 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