+ Reply to Thread
Results 1 to 5 of 5

Addition and Subtraction of cells code error

  1. #1
    Registered User
    Join Date
    02-12-2015
    Location
    florida
    MS-Off Ver
    office 2010
    Posts
    4

    Addition and Subtraction of cells code error

    I have a range of cells E1:E100 with, just values. I would like to put a number in the corresponding cell G, hit ENTER, and have this number subtracted from the cell in column E, and display the result. I then would like the cell in column G to go blank so it can have another entry at a future date.
    Likewise I would like to put a number in the corresponding cell F, hit enter and have this number added to the cell in column E, and display the result. I then would like the cell in column F to go blank so it can have another entry at a future date.

    Example: E1 contains the number 10. I type in the number 3 in cell G1 and hit ENTER. E1 should change to number 7 and cell G1 should now be blank. If i typed the number 4 in cell F1 instead and hit ENTER, E1 would have changed to number 14 and cell F1 should now be blank.

    I thought this code should do that but it does not seem to work:

    Please Login or Register  to view this content.
    Thanks in advance for any help.
    Last edited by Jim_Johnson; 02-12-2015 at 02:53 PM. Reason: moderators request

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,447

    Re: problem with code

    Hi Jim and welcome to the forum,

    I think this is what you want...

    Please Login or Register  to view this content.
    Also - could you edit your above post and select the code and click on the "#" icon that will put code tags around it and make it much more readable?
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    02-12-2015
    Location
    florida
    MS-Off Ver
    office 2010
    Posts
    4

    Re: problem with code

    Thanks for the help Martin. That Worked Great!!

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,447

    Re: problem with code

    Hi Jim,

    You need to Edit your post and select the part that is code. Then click on the "#" icon above the message area. Then Save the edit and see the code in a code box.

    You also need to change the title of your original post to something better like "Proper use of the Select Case statement". This will help us find your question later. Zbor will then add back the answer I gave to solve your problem.

  5. #5
    Registered User
    Join Date
    02-12-2015
    Location
    florida
    MS-Off Ver
    office 2010
    Posts
    4

    Re: problem with code

    Ok thanks. I made the changes. Hopefully it can be reposted on the board so other people can see your solutions. If the changes arent good please let me know and ill do whats needed. Again thanks for the help it worked great!!

+ 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 save as pdf code problem in code any help please ?
    By tytyseka in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-11-2015, 11:33 PM
  2. [SOLVED] Code Problem: How to Write this into a VBA code
    By rlkerr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-28-2013, 02:46 AM
  3. Replies: 2
    Last Post: 01-22-2013, 07:09 AM
  4. Code problem.
    By Flower R in forum Excel General
    Replies: 0
    Last Post: 12-15-2008, 09:42 PM
  5. [SOLVED] Code problem
    By Patrick Simonds in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-15-2005, 08:05 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