Results 1 to 4 of 4

Excel 2010 - VBA - calculate and Copy paste value upon data entry in another cell

Threaded View

  1. #1
    Registered User
    Join Date
    03-10-2013
    Location
    Switzerland
    MS-Off Ver
    Excel 2003
    Posts
    5

    Excel 2010 - VBA - calculate and Copy paste value upon data entry in another cell

    Hello all,

    I am seeking support for VBA, I am trying to create VBA code that copies and pastes data value, after data entry in another cell from the same row, I do not have great experience with VBA and so I am struggling to create such a code.

    please have a look to the attached file and picture.

    When entering a mouvement "in" colum C, or mouvement "out" in column D,
    I have a vlookup to a pivot table (with automatic data refresh after each data entry) in separate sheet that gave me the current stock (column E ), this only give me the sum of stock entry minus sum of stock release from the pivot table. .


    I would like to have the stock before and after when adding a quantity in or out (Displayed in Red in table below) Something like:
    Once I enter data in col D or C
    for the same row
    Copy-paste value of stock current (after data entry), in cell stock after.
    Calculate and copy paste value of : stock after+OUT-IN, in cell stock before.


    The vloookup on pivot table will continue to give me the current stock, and the column stock before and stock after, will gave me the stock situation at the moment of the movement (so they should have value only, no formulas)


    I do not want to ask too much, but as i am very limited , can you also kindly write also the "Dim." needed if any,
    My Workbook name is : stock antoine.xlsm
    My Worksheet name is : Stock - Mouvements


    So far the only Macro I have is to update after udpate the pivot table with the following code :



    Private Sub Worksheet_Change(ByVal Target As Range)
    'refresh pivot after any changes in sheet Stock balance
    ThisWorkbook.RefreshAll
    End Sub
    On top of that i would like to have a sometime that prevent me from entering data in the columns C and D, it should be either a "Quantity In" or "Quantity out", something like: If the other cell is not empty then forbid data entry .

    Thank you very much in advance for your help


    Antoine
    Humanitarian worker

    table.png
    Attached Files Attached Files
    Last edited by lantuan; 09-03-2019 at 03:28 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Paste data to another sheet based on cell criteria(s) - VBA Excel 2010
    By magneto_sphere in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-20-2015, 11:40 AM
  2. disable copy/cut/paste/paste special in excel 2010
    By Alina Loredana in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-22-2014, 06:43 PM
  3. How to paste special in Outlook 2010 from a copied cell in Excel 2010
    By Baldowsky in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 05-30-2014, 11:40 AM
  4. Unable to calculate copy / paste data in Excel
    By ianarman in forum Excel General
    Replies: 1
    Last Post: 04-21-2014, 12:53 AM
  5. copy and paste excel rows based on cell entry
    By camileigh in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-16-2013, 12:05 PM
  6. Replies: 1
    Last Post: 03-13-2013, 02:27 PM
  7. Replies: 0
    Last Post: 07-29-2011, 07:19 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