+ Reply to Thread
Results 1 to 6 of 6

Finding and Moving Cells From Sheet to Sheet

  1. #1
    Registered User
    Join Date
    12-08-2010
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    14

    Finding and Moving Cells From Sheet to Sheet

    Hi Everyone,



    I am looking to do the following. a1) Find a cell called 'test' in sheet2 of my workbook.

    2) Cut the value in the cell to the right of the 'test' cell

    3 Find a cell called 'test' in sheet1

    4) Finally, paste the value found in step2 to the cell to the right of the cell found in step3.



    My code is below, any help will be much appreciated!



    Kind Regards



    Ross



    Please Login or Register  to view this content.

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Finding and Moving Cells From Sheet to Sheet

    Maybe:

    Please Login or Register  to view this content.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    12-08-2010
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Finding and Moving Cells From Sheet to Sheet

    Sorry for the confusion there Dom!

    When I try and run your code, I get the following error:

    "Object variable or With block variable not set"

    for the line of code:

    destinationcell.Offset(0, 2).Value = sourcecell.Offset(0, 2).Value

    Any ideas?

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Finding and Moving Cells From Sheet to Sheet

    That means it hasn't found a cell containing Test on either Sheet1 or Sheet2.

    Can you post a sample workbook that demonstrates the error occurring?

    Dom

  5. #5
    Registered User
    Join Date
    12-08-2010
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Finding and Moving Cells From Sheet to Sheet

    Changed the offset values to 1 instead of 2 and it worked a treat!

    Thank you very much again Dom!

  6. #6
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Finding and Moving Cells From Sheet to Sheet

    No worries. Please mark the thread Solved.

    Oh, and don't forget to put your code in tags in future

    Dom

+ 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