+ Reply to Thread
Results 1 to 7 of 7

A macro that enters "xx" next to a cell that is a non-zero value

  1. #1
    Registered User
    Join Date
    07-20-2015
    Location
    New York
    MS-Off Ver
    2305 - Enterprise 365
    Posts
    147

    A macro that enters "xx" next to a cell that is a non-zero value

    Hello All,
    I would like some VBA language that will enter "xx" if the value in the adjoining cell is a non-zero number.
    As you can see in the result tab, if the "number" cell is zero then the "amount" cell remains zero.
    If the "number" cell is not zero, then the adjoining amount cell is replaced with "xx".
    If you have any VBA language that would be of assistance, I would be most appreciative.

    Best,
    Andrewstupendo

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,228

    Re: A macro that enters "xx" next to a cell that is a non-zero value

    Why VBA?

    =IF(A2=0,0,"xx")
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    07-20-2015
    Location
    New York
    MS-Off Ver
    2305 - Enterprise 365
    Posts
    147

    Re: A macro that enters "xx" next to a cell that is a non-zero value

    I would like to use VBA language instead of a formula so that I don't have to add more columns to a spreadsheet that already has many columns.

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,531

    Re: A macro that enters "xx" next to a cell that is a non-zero value

    Please Login or Register  to view this content.
    Experience trumps academics every day of the week and twice on Sunday.

  5. #5
    Registered User
    Join Date
    07-20-2015
    Location
    New York
    MS-Off Ver
    2305 - Enterprise 365
    Posts
    147

    Re: A macro that enters "xx" next to a cell that is a non-zero value

    Hello Jolivanes,
    Thank you for the VBA language which worked perfectly.
    Unfortunately, my example I left out some important information for which I apologize.
    I am now sending you an accurate version of what I have in mind. You will notice in the initial state tab that some of the amounts in column B are greater than zero.
    The result tab shows that the macro should only enter "xx" if the cell in column B is zero, but the adjoining cell in column A is greater than zero.
    I have attached a new example spreadsheet for your review. Once again, my apologies.

    Best regards,
    Andrewstupendo

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,228

    Re: A macro that enters "xx" next to a cell that is a non-zero value

    Please Login or Register  to view this content.

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,250

    Re: A macro that enters "xx" next to a cell that is a non-zero value

    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

+ 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. [SOLVED] Excel 2010 -- "Visual Basic" "Macros" and "Record Macro" all disabled.
    By NicholasL in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-07-2017, 06:11 AM
  2. "Coloring macro" and a "copy if cell contents are .." macro are interfering
    By dreddster in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-26-2015, 08:30 AM
  3. [SOLVED] macro to search for "NO" in a cell and copy all but "NO" to a different column! plz help
    By fredderf81 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-26-2013, 03:19 PM
  4. "Form and macro" to delete "Active" cell contents.
    By wanty in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-22-2013, 11:33 PM
  5. [SOLVED] strange behaviour: typing "WEI" but Excel enters it like "WIE"
    By buhnen in forum Excel General
    Replies: 3
    Last Post: 05-03-2012, 09:19 AM
  6. How can i copy value from "HTMLText"(EMBED("Forms.HTML:Text","")),using Macro
    By andrewyang in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2010, 12:47 AM
  7. How HardDisk neme "N" or "?" (as cell value) insert into macro formula?
    By frenic in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-14-2008, 08:40 AM

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