+ Reply to Thread
Results 1 to 6 of 6

macro to adjust rounding value at random cell based on a cell value in another sheet

  1. #1
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,145

    macro to adjust rounding value at random cell based on a cell value in another sheet

    I have a workbook with 2 sheets estimate and data sheet summary.

    In estimate sheets there is a value at cell R2 29828

    In data sheet summary column E are cells rounded amount still to last row before sum which equals 29830.

    The data is dynamic on both sheets but value at R2 data is entered manually as a counter check .

    Am looking a vba code that can adjust at random any value of columns E so that the total equals 29828 which is must be equal to that of cell R2 of estimate sheet.

    Note as example that if cell R2 of estimate sheet is 30546 and the total on Summary data sheet is 30543 then it should adjust at random any value of column E but however

    the value should be adjusted by 1 or -1 by cell of column E meaning that if there is a difference of -3 or 3 , then a random cell should be adjusted by 1 number

    only , that is it cannot adjust a cell value E4 FROM 10 to 7 OR 10 TO 13.

    The difference should always adjust whether by 1 value per cell not a cell be adjusted by 3 value directly

    Note the data is dynamic there may be 100 or 3000 rows before summing data summary sheet .
    Attached Files Attached Files

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: macro to adjust rounding value at random cell based on a cell value in another she

    Maybe :
    Please Login or Register  to view this content.
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,145

    Re: macro to adjust rounding value at random cell based on a cell value in another she

    Hello Karedog

    Tested both with value over and value less bravo it rocks in both ends ,however is it possible to amend so that it work in the same column of E .

    You save me from a very daily tedious task.

  4. #4
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: macro to adjust rounding value at random cell based on a cell value in another she

    Hi Jean, thanks for the reps.
    Ok if you are already sure, the code will put the output on the same column.

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    02-11-2014
    Location
    mauritius
    MS-Off Ver
    MS365
    Posts
    1,145

    Re: macro to adjust rounding value at random cell based on a cell value in another she

    Thank you work as a charm

  6. #6
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: macro to adjust rounding value at random cell based on a cell value in another she

    You are welcome, thanks for marking the thread as solved and rep.points.

    Regards

+ 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] Adjust row height based on cell
    By mainemojo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-26-2018, 06:23 PM
  2. Using Macro to change cell color based on reference cell value in different sheet
    By Emma Ford in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-09-2015, 03:51 AM
  3. [SOLVED] Adjust a macro to copy different cells based on sheet name
    By dreddster in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-25-2015, 11:37 AM
  4. [SOLVED] Adjust a macro to check for content of a cell and then run a macro on target sheet
    By dreddster in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-17-2013, 04:37 AM
  5. Automatically Adjust Cell Height Based On Other Cell Value
    By Muttly in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-24-2013, 06:36 AM
  6. Cell Rounding Macro - significant digits is variable from cell to cell
    By schmidt62 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-04-2012, 05:06 PM
  7. [SOLVED] Adjust Multiple Cell Borders Based on Cell Contents
    By USFishin in forum Excel General
    Replies: 16
    Last Post: 04-10-2012, 12:56 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