+ Reply to Thread
Results 1 to 9 of 9

edit code

  1. #1
    Registered User
    Join Date
    01-14-2008
    Posts
    76

    edit code

    hello

    i was wondering if you could help me edit this code

    So far the code copies the value in cell "F15" in sheet 4 and pastes the value in sheet 18, cell D6
    but the problem is that everytime i click it it just replace the value in sheet 18cell "D6" i want it to go down by a cell everytime it is clicked

    The code is:

    Sheet18.Cells.Range("D6").Value = Sheet18.Cells.Range("D6").Value + Sheet4.Cells.Range("F15").Value
    thanks in advance

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Not sure if you want the D6 changed in both parts of the code or only the 1st part

    This is for the 1st part - It places the value in the next vacant cell in column D
    Please Login or Register  to view this content.
    Another way if both D6 referneces need to be changed
    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Registered User
    Join Date
    01-14-2008
    Posts
    76
    The code that you provided dosent seem to work when i click the macro nothing happens

    i have attached a sheet which will explain what i mean


    thanks for your help tho
    reli apreciate it

  4. #4
    Registered User
    Join Date
    01-14-2008
    Posts
    76
    This is the attachment

    thanks in advance
    Attached Files Attached Files

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    There's no code in your example.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  6. #6
    Registered User
    Join Date
    01-14-2008
    Posts
    76

    Attached File

    sorry about that i have atteched the file

    thanks in advance
    Attached Files Attached Files

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You say you want to copy to sheet2, then sheet 3. Is that wrong?

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I think this is what you mean

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    01-14-2008
    Posts
    76
    Thats what i want thanks

    but with this code it dont copy to Cell D2 in sheet 2 if the is a forula in in D5
    why is that

    the code should let it copy to D2 downwards

    thanks in advance

+ 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