+ Reply to Thread
Results 1 to 4 of 4

Find file in specific folder+renaming it automatically after cell update in other workbook

  1. #1
    Forum Contributor
    Join Date
    10-07-2015
    Location
    cyprus
    MS-Off Ver
    Microsoft 365
    Posts
    182

    Find file in specific folder+renaming it automatically after cell update in other workbook

    I am using as database a file "cargoes 2016" sorted by "reference number" which creates/saves automatically a file "calc sheet" in another folder naming it correctly.

    I would like that as soon as the cell "AI"(=date) of "cargoes 2016" is updated, the VBA code:

    - goes to the folder of calc sheet
    - find the relevant calc sheet title, the searching criteria the "reference number"
    - rename the relevant calc sheet title adding at the end the "date"

    here is the code I have until now (input under "cargoes 2016")

    Please Login or Register  to view this content.

  2. #2
    Forum Expert JapanDave's Avatar
    Join Date
    06-10-2008
    Location
    The grid, I got in!
    MS-Off Ver
    Excel 2010/13
    Posts
    1,696

    Re: Find file in specific folder+renaming it automatically after cell update in other work

    Can you be more detailed on the conditions. And I am guessing that you are getting quite a few errors with that code. And is this code in a userform?
    Be fore warned, I regularly post drunk. So don't take offence (too much) to what I say.
    I am the real 'Napster'
    The Grid. A digital frontier. I tried to picture clusters of information as they moved through the computer. What did they look like? Ships? motorcycles? Were the circuits like freeways? I kept dreaming of a world I thought I'd never see. And then, one day...

    If you receive help please give thanks. Click the * in the bottom left hand corner.

    snb's VBA Help Files

  3. #3
    Forum Contributor
    Join Date
    10-07-2015
    Location
    cyprus
    MS-Off Ver
    Microsoft 365
    Posts
    182

    Re: Find file in specific folder+renaming it automatically after cell update in other work

    the table "cargoes 2016" indeed use a userform to enter/view data (here attached the file).

    Each time a new entry is create via this userform, it creates/name automatically a file "calc sheet" saved in another location and based on a template. The new calc sheet is renamed as per info entered based on a specific title format (all this works perfectly).

    what I would like is that each time I update the column "AI" of the "recap"sheet of cargoes 2016, the code goes to the folder of the calc sheet, find in the titles the one of "cargoes 2016/recap/column c" and automatically (without opening it) rename the calc sheet adding at the end of the title "cargoes 2016/recap/column c/column "AI".value

    For example, as per attachment, if in "cargoes 2016" I insert in the column "AI" for the ref 2016CT007 "21-12-15", The code should go in the specific location, find the calc sheet whose title includes "2016CT007" (HERE ATTACHED) and renamed it adding at the end of the title before the extention "-" & "21-12-15" (i.e. cargoes 2016/recap/column c/column "AI".value) without opening the file

  4. #4
    Forum Contributor
    Join Date
    10-07-2015
    Location
    cyprus
    MS-Off Ver
    Microsoft 365
    Posts
    182

    Re: Find file in specific folder+renaming it automatically after cell update in other work

    I amended the code so that after inserting via the userform of cargoes 2016 a "BL DATE" (=CELLS "AI"), and clicking save of the userform (i.e. to update the related cell), the code goes to the specific location, find the file whose name includes the "REF.value", and rename it....

    Please Login or Register  to view this content.
    However I get an error "file not found", when putting the cursor on "oldname" and "newname" all looks ok......can someone help on this case?

+ 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] VBA Code required for renaming files in a specific folder
    By yoursamrit2000 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-24-2015, 05:11 PM
  2. [SOLVED] macro to find file in a specific folder and return data
    By Shellybelly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-19-2014, 10:10 AM
  3. Replies: 4
    Last Post: 10-17-2014, 09:31 AM
  4. Button to save workbook, with value in specific cell (H5), in a specific folder
    By markeeny in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-31-2014, 01:15 PM
  5. Automatically extract data from another file in the same folder as the active workbook
    By msexceljones in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-30-2013, 12:51 AM
  6. saving to a specific file as workbook is update
    By superchew in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-09-2013, 06:22 AM
  7. Replies: 15
    Last Post: 08-27-2012, 10:13 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