+ Reply to Thread
Results 1 to 7 of 7

make all input negative

  1. #1
    Registered User
    Join Date
    10-22-2007
    Posts
    39

    make all input negative

    I need a formula or code to make any number i put into a cell negative. I need it for latitudes because when they get imported into mappoint it uses +/- to determine east or west.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    Hi zb61,

    The following code attached to your worksheet will change all values to negative as you enter them. It will also allow you to directly enter negative values (by accident or on purpose) through the IF statement.
    Please Login or Register  to view this content.
    Updated code to handle text strings, the previous code would fail.
    Last edited by Paul; 10-31-2007 at 09:39 PM.

  3. #3
    Registered User
    Join Date
    10-22-2007
    Posts
    39
    is there a way to just make that focus on a certain column?

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    Sure, it can be modified to:
    Please Login or Register  to view this content.
    Change the Columns(1) to the column you want it to affect. B=2, F=6, etc.

  5. #5
    Registered User
    Join Date
    10-22-2007
    Posts
    39
    Thank you very much. Man I really wish I remembered more programming from college.

  6. #6
    Registered User
    Join Date
    10-22-2007
    Posts
    39
    I've been using that code but changed it to column 6. However, whenever I copy and paste anything into the worksheet or drag values across multiple cells I get a debugging error. I think it says "Error 13, Mismatch Error" or something along those lines. Anyone know how to fix that?

  7. #7
    Registered User
    Join Date
    10-22-2007
    Posts
    39
    Quote Originally Posted by pjoaquin
    Sure, it can be modified to:
    Please Login or Register  to view this content.
    Change the Columns(1) to the column you want it to affect. B=2, F=6, etc.
    Anyone know how to fix this code so I don't get a "Run-time Error 13. Type Mismatch Error" everytime I copy/paste or fill stuff in the worksheet?

+ 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