Results 1 to 10 of 41

Thread: copy,paste,calculate Cell value based on calculations & comparisonsother cells same row. Decimal places

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #29
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    Quote Originally Posted by fixer View Post
    .. as u know i am not that smart
    ..You are smart enough to get others to do your work .. maybe
    आपण मुर्ख नाही कारण आपण इंग्रजीमध्ये संप्रेषण करू शकत नाही. मी मराठी किंवा हिंदी बोलू शकत नाही. पण या कारणास्तव मी मूर्ख नाही

    I try this as the Question…..
    Explanation 2

    For all data rows, we compare column H to column D. If column H is greater than column D , then we adjust the value in column K up to the nearest multiple of .05. If column H is less than column D , then we adjust the value in column K down to the nearest multiple of .05. ( If the value in column K is an exact multiple of .05, then no action is to be taken )


    VBA answer

    Put columns in arrays
    Row\Col
    D
    1
    Open
    2
    1087
    3
    148.05
    4
    265
    5
    30.4

    arrD() =
    1087
    148.05
    265
    30.4



    Row\Col
    H
    1
    LTP
    2
    1079.9
    3
    146.5
    4
    267.15
    5
    29.95

    arrH() =
    1079.9
    146.5
    267.15
    29.95



    Row\Col
    K
    1
    2
    1090.69
    3
    147.95
    4
    264.47
    5
    30

    arrK() ( initial ) =
    1090.69
    147.95
    264.47
    30


    The macro below manipulates the contents of arrK() as per the question requirement, then pastes the modified array over the initial values
    Macro here: http://www.excelfox.com/forum/showth...ll=1#post13105

    After running that macro, Sub ChangeSecondNumberAfterDecimalConditionally() , the arrK() contents change to
    1090.65
    147.95
    264.5
    30


    And that is then pasted out into the range
    Row\Col
    K
    1
    2
    1090.65
    3
    147.95
    4
    264.5
    5
    30
    Last edited by DocAElstein; 04-21-2020 at 02:28 PM.
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    KILL A MODERATOR!!

Similar Threads

  1. Replies: 26
    Last Post: 09-26-2020, 05:56 PM
  2. Replies: 6
    Last Post: 08-28-2019, 09:42 AM
  3. copy data and paste it in another sheet
    By newbie2 in forum Excel Help
    Replies: 1
    Last Post: 07-15-2015, 01:38 PM
  4. Trapping Copy To Range Before Copy/Cut Paste
    By Rasm in forum Excel Help
    Replies: 4
    Last Post: 04-07-2011, 07:48 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •