+ Reply to Thread
Results 1 to 11 of 11

rename open file after close for amount is in adjacent word in cell without add new file

  1. #1
    Forum Contributor
    Join Date
    09-25-2022
    Location
    Libya
    MS-Off Ver
    2019
    Posts
    110

    rename open file after close for amount is in adjacent word in cell without add new file

    Hi experts,
    I would thank for MSDols' codes to help me in previous thread.
    now I would macro to put end of the code should do :
    1- save file without prompt
    2- close the file without close others open EXCEL files
    3- rename open file after follow step1,2 based on amount is existed in column D for adjacent cell "AMOUNTS TOTAL" for column C
    4- so the name will be AMOUNTS TOTAL 238,815.00 (should be the same number format as in cell "#,##0.00"
    5- when run the macro should rename for the same file without add new file whether the same renaming or different renaming.
    also I posted in this forum
    https://www.mrexcel.com/board/thread...2#post-6259745
    thanks
    Attached Files Attached Files
    Last edited by Mussala; 04-13-2025 at 05:11 AM.

  2. #2
    Forum Contributor
    Join Date
    01-25-2025
    Location
    Presov, Slovakia
    MS-Off Ver
    2021
    Posts
    208

    Re: rename open file after close for amount is in adjacent word in cell without add new fi

    Hi,
    try it.
    Last edited by MSDols; 04-14-2025 at 04:29 PM. Reason: I fixed the error in the code

  3. #3
    Forum Contributor
    Join Date
    01-25-2025
    Location
    Presov, Slovakia
    MS-Off Ver
    2021
    Posts
    208

    Re: rename open file after close for amount is in adjacent word in cell without add new fi

    Hi Mussala,
    still fixing the code before closing
    m.s.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    09-25-2022
    Location
    Libya
    MS-Off Ver
    2019
    Posts
    110

    Re: rename open file after close for amount is in adjacent word in cell without add new fi

    Hi again,
    ok I tested ,but there is problem !
    when change amounts for some files and add or delete new files contains amounts the original code does not extract correct amounts in column D as in previous thread, will keep old amounts had ever extracted , I don't see any change in column D when change adding or deleting amounts for new file or old file within directory!

  5. #5
    Forum Contributor
    Join Date
    01-25-2025
    Location
    Presov, Slovakia
    MS-Off Ver
    2021
    Posts
    208

    Re: rename open file after close for amount is in adjacent word in cell without add new fi

    Hi Mussala,
    the first thing the code does is delete the old values.
    I added "debug steps" to the file.
    Check the address where the new file will be written - last message.
    By deleting cell F1, the "debug steps" will not be displayed.
    m.s.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    09-25-2022
    Location
    Libya
    MS-Off Ver
    2019
    Posts
    110

    Re: rename open file after close for amount is in adjacent word in cell without add new fi

    I'm not sure where get amounts from !!
    may you compare amounts inside sheet with picture in the folder ?!
    Attached Images Attached Images
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    01-25-2025
    Location
    Presov, Slovakia
    MS-Off Ver
    2021
    Posts
    208

    Re: rename open file after close for amount is in adjacent word in cell without add new fi

    in the "Report" sheet there will be a list of what the code found.
    It will be visible from which files it takes the numbers. (Original list).
    The problem may be with other subdirectories that you do not want to have included in the report.
    Or a different extension of the excel files. Or the number is in a different column.
    m.s.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    09-25-2022
    Location
    Libya
    MS-Off Ver
    2019
    Posts
    110

    Re: rename open file after close for amount is in adjacent word in cell without add new fi

    is deleted
    Last edited by Mussala; 04-16-2025 at 06:18 AM.

  9. #9
    Forum Contributor
    Join Date
    09-25-2022
    Location
    Libya
    MS-Off Ver
    2019
    Posts
    110

    Re: rename open file after close for amount is in adjacent word in cell without add new fi

    thanks
    I've found my bad in lastrow for column D the amount is not the same amount for the file name.
    I think we missed thing in previous thread should rename files first and you tell me
    If the names are OK, we proceed to the second stage.
    I suspect renaming files this is next step has missed!

  10. #10
    Forum Contributor
    Join Date
    01-25-2025
    Location
    Presov, Slovakia
    MS-Off Ver
    2021
    Posts
    208

    Re: rename open file after close for amount is in adjacent word in cell without add new fi

    in the sheet "Report" there will be new names of source files xls.
    Check the correctness of the new name.
    If it is OK, delete cell "G1" in sheet "Rename". Run the code again.
    m.s.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    09-25-2022
    Location
    Libya
    MS-Off Ver
    2019
    Posts
    110

    Re: rename open file after close for amount is in adjacent word in cell without add new fi

    I think last version you provided me works greatly and treat my problems.
    many thanks.

+ 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. Replies: 8
    Last Post: 12-02-2019, 03:42 PM
  2. [SOLVED] File dialog box to open a excel file then copy data close file
    By mmikem in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-01-2019, 09:57 AM
  3. How do I open, insert a table, save & close a word file via excel
    By partha.raha in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-15-2015, 12:40 AM
  4. Problem With Open File and Save File With Saveas and then close the File
    By John Vieren in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-27-2013, 12:53 AM
  5. Open 2nd file(CSV) from cell reference, copy columns to main file & close 2nd file
    By Langchop in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2013, 05:09 AM
  6. Check if a Word File is Open and If Open Close it with Excel VBA.
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-10-2012, 11:14 AM
  7. How to: Open file, format data, save file, close file and repeat.
    By thexeber in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-11-2010, 12:56 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