+ Reply to Thread
Results 1 to 8 of 8

substracting matrix

  1. #1
    Registered User
    Join Date
    07-12-2020
    Location
    indonesia
    MS-Off Ver
    2016
    Posts
    4

    substracting matrix

    hi all sorry before if this question look stupid cause i am just a non programing people but try to simplify my work. and thanks for anyone who answer this

    so this is the case, i wanna make a button which when i click it, it will substract data in column "A" with data in column "B" and the result will be in column "A", replace previous data. and this both column have the same amount of data.
    for now i use the code copy and pastespecial operation substract. and my code like this

    Please Login or Register  to view this content.
    but i still searching if there any more efficient way.

    and i see matrix substraction. but the example is to difficult for me to understand cos i dont understand which column they try to substract( i don't see any set for specific range).
    so is my copy paste special still more efficient or matrix substraction better ? cos my current program run so slow in office 2016. and if matrix better can u tell me the program to substract column "A" with column "B" and the result put in column "A" replacing previous data?

    thanx before
    Last edited by frezty; 07-13-2020 at 09:56 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,928

    Re: substracting matrix

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. As you are new, I have done it for you this time.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: substracting matrix

    I think you're better off with your copy-paste routine rather than putting the array formula in every destination cell
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Registered User
    Join Date
    07-12-2020
    Location
    indonesia
    MS-Off Ver
    2016
    Posts
    4

    Re: substracting matrix

    oh i see. i also feel copy paste better cause matrix substract will take much program. ur answer make me more confident to use it. thanks
    than can u give me advice how to make vba run faster? i already tried what i find in google like avoid use select, turn of event, manual calcualtion, avoid too much line use "," and ":" etc. but i still feel my program run to slow.
    i use a button which when i click, it will do both copy paste substract and save workbook. but this took almost 10s more in excel 2016(before i use excel 2013). or is it better if i just throw the saving workbook program and do it manually?

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: substracting matrix

    In order to advise you, I need to see your code

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: substracting matrix

    Is your code similar to this?

    Please Login or Register  to view this content.
    And, thanks for the rep!

  7. #7
    Registered User
    Join Date
    07-12-2020
    Location
    indonesia
    MS-Off Ver
    2016
    Posts
    4

    Re: substracting matrix

    yup like that. only in code saving i use
    Please Login or Register  to view this content.
    (btw my file name is DATA )
    is my saving way that make it run uneffieciently?

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: substracting matrix

    I'm not sure but maybe - try it my way and see

+ 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] Substracting Times from current time
    By Grahamfeeley in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-23-2020, 01:22 AM
  2. Invoice Tracker (adding and substracting)
    By ukman2012 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-03-2020, 03:51 PM
  3. Substracting times in [h]:mm format
    By wlan in forum Excel General
    Replies: 2
    Last Post: 05-29-2011, 01:40 PM
  4. Substracting Previous Row from Current Row
    By Prem in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 10-01-2007, 10:32 AM
  5. Substracting dates and times
    By pietjeplezier in forum Excel General
    Replies: 3
    Last Post: 03-02-2007, 07:48 PM
  6. Substracting Dates.
    By exsam21 in forum Excel General
    Replies: 3
    Last Post: 01-20-2006, 03:20 PM
  7. Substracting from a column
    By venus21pam in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 01-11-2006, 03:18 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