+ Reply to Thread
Results 1 to 9 of 9

An "adding" PASTE and a CELL update

  1. #1
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    An "adding" PASTE and a CELL update

    Hi

    I need 2 macros:

    1. An ordinary macro that would copy values only of G7:G29 pasting them to H7:H29 BUT adding the G value to the H value.
    For example, H11 would become 223.74.

    2. An automatic sheet changing macro that when a value (numeric) is entered in J7:J29, that value would be subtracted from either the value in H or I, same row, which ever is filled, and the value in H or I would be updated.
    (H and I will NEVER have values on the SAME row).
    The value entered in J cannot be greater than the value entered in H or I.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by drgkt; 01-20-2017 at 04:40 AM.

  2. #2
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Re: An "adding" PASTE and a CELL update

    Anyone please...

  3. #3
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: An "adding" PASTE and a CELL update

    1.-

    Please Login or Register  to view this content.
    2.-

    Please Login or Register  to view this content.
    Last edited by vichopalacios; 01-20-2017 at 05:37 PM.
    Barriers are there for those who don't want to dream

  4. #4
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Re: An "adding" PASTE and a CELL update

    Thank you for helping me achieve this!
    edit: Thank you for achieving this for me!

    Re: sheet code

    On testing, I saw once the message that the value was greater than H or I, not seeing it any more nor the values are reduced by J
    Attached Files Attached Files
    Last edited by drgkt; 01-20-2017 at 07:13 PM.

  5. #5
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Re: An "adding" PASTE and a CELL update

    Re Macro 1.

    To get rid of zeros I changed formula in G7:G29 to "=IF(E7="√";"";IF(D7-F7=0;"";D7-F7))"
    Now I am getting RunTime ERROR 13: Type mismatch
    Sht.Cells(i, 8).Value = Sht.Cells(i, 7).Value + Sht.Cells(i, 8).Value


    p.s. If G is blank and H is blank H becomes zero instead of be left blank
    Last edited by drgkt; 01-22-2017 at 01:46 AM.

  6. #6
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Re: An "adding" PASTE and a CELL update

    Ok. Despite the minor details above,

    Macro 1: Usable as is, and optionally formatting zero values to be invisible.

    HOWEVER

    Macro 2: Is not working as supposed to. Sometimes it gives the message "Value is grater than H or I", sometimes it is not, BUT FAILS to add the value to either H or I.


    Someone to take a look in the code please!

  7. #7
    Forum Contributor
    Join Date
    01-20-2014
    Location
    Greece
    MS-Off Ver
    20 yr. old Excel 2002!
    Posts
    710

    Re: An "adding" PASTE and a CELL update

    Deleted this post
    Last edited by drgkt; 01-22-2017 at 03:10 AM.

  8. #8
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: An "adding" PASTE and a CELL update

    Hi @ drgkt

    My answers take sometimes longer than you may like
    I'm sory, I'm not a 24/7 follower of this site, I just come here from time to time, when I'm free, and feel the liking.

    for macro#1
    If you want not to do anything when there is nothing in H(i), then you can change to this:

    Please Login or Register  to view this content.
    for macro# let me check, I think I understand your point.

  9. #9
    Valued Forum Contributor
    Join Date
    08-07-2014
    Location
    Quito, Ecuador
    MS-Off Ver
    Excel 2016 & 365, Windows 10
    Posts
    511

    Re: An "adding" PASTE and a CELL update

    Hi @ drgkt

    Macro 2: Is not working as supposed to. Sometimes it gives the message "Value is grater than H or I", sometimes it is not, BUT FAILS to add the value to either H or I.
    I think I found the bug.
    by sure, with the previous code, after you saw the "Value is greater than H or I" message, the worksheet started to show a weird performance.
    it was because we ended the sub leaving "Application.EnableEvents = False"
    now, try with this please.
    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)

Similar Threads

  1. Replies: 1
    Last Post: 01-22-2016, 09:21 AM
  2. Update Macro to search column Bfor "Fail" and "Exception"
    By programct in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-10-2014, 02:32 PM
  3. solution for the blank cell using the IF function
    By ragnaedge in forum Excel General
    Replies: 4
    Last Post: 08-23-2013, 11:03 AM
  4. [SOLVED] Need to modify the Paste function of this VBA Macro from "Paste" to "Paste Special Values"
    By zicitron in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-04-2013, 03:44 AM
  5. Replies: 0
    Last Post: 11-20-2012, 10:22 AM
  6. [SOLVED] What is Error "Method "Paste" of object "_Worksheet" failed?
    By vat in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-17-2006, 04:10 PM
  7. Replies: 1
    Last Post: 01-30-2006, 06:10 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