+ Reply to Thread
Results 1 to 5 of 5

move amounts from column to another based on word in another column

  1. #1
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    205

    move amounts from column to another based on word in another column

    hi
    I have many names contain amounts for credit and debit so if there is cell contain word PAID in column C then should move the amount from column D to column E and if there are cells in column E contain value when move amount from column D then should add over it and sum the values . I put the result in SH2 , but it should show in sheet SH2.
    thanks
    Attached Files Attached Files
    Last edited by Hasson; 11-04-2021 at 06:10 AM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,607

    Re: move amounts from column to another based on word in another column

    If I understood well, you can try suc procedure (or similar one):
    Please Login or Register  to view this content.

    edit: I've corrected the code to properly use dot qualifiers. Please note that a file contains the old version of the code, so use the above one
    Attached Files Attached Files
    Last edited by Kaper; 11-04-2021 at 06:25 AM.
    Best Regards,

    Kaper

  3. #3
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    205

    Re: move amounts from column to another based on word in another column

    Cells(x, "C").ClearContents ' you may delete this line to leave "PAID" after transg=fer is done
    yes I want staying the word PAID after move amount .just curosity can you using array with dictionary ? in future I'm afraid the data will be big and the code becomes slow
    Last edited by Hasson; 11-04-2021 at 06:06 AM.

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,607

    Re: move amounts from column to another based on word in another column

    I can't see a good reason to use dictionary here (would be usefull to produce a list containing only changed values or for aggregating several rows data about the same name, etc.).
    Just array would do. And array is what I'd use myself in my code for daily tasks. But after looking on a code already inside the file, I posted the above version with a loop writing directly into cells, as it is easier to read and understand (but slower).

    So with an array it could look like this:

    Please Login or Register  to view this content.
    Shall be pretty fast also for very large files.

  5. #5
    Forum Contributor
    Join Date
    05-08-2021
    Location
    ALQUDS
    MS-Off Ver
    2019
    Posts
    205

    Re: move amounts from column to another based on word in another column

    that's better. I tested their speed for about 650 rows . first gives 0.14 ,second 0.02
    great work! much appreciate for your assistance

+ 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. macro if data in column a = set word to insert that column into sheet 2 or 3 based on word
    By ExcelBeginner326 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-13-2014, 01:57 PM
  2. [SOLVED] Seperate data in column A that has specific word and move to column B or C or D
    By jachbo in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 09-05-2013, 09:08 PM
  3. Replies: 8
    Last Post: 04-19-2013, 12:06 PM
  4. sum amounts in one column based on dates in another column
    By Mark_Delaware in forum Excel General
    Replies: 1
    Last Post: 01-25-2011, 10:14 PM
  5. Copy/move a word from a cell in a column to another column and autofill
    By excelaspire0219 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-05-2009, 03:54 PM
  6. Help! Grouping amounts in one column based on id on another column
    By explorart in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-17-2006, 04:12 PM
  7. Add amounts in a column based on transaction date in another column
    By jonco in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-08-2006, 07:50 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