+ Reply to Thread
Results 1 to 4 of 4

Deleting characters assigned in the variable

  1. #1
    Forum Contributor
    Join Date
    05-13-2019
    Location
    Halifax, Canada
    MS-Off Ver
    2016
    Posts
    176

    Deleting characters assigned in the variable

    Hi there,

    My macro gets the name of the target file (eg. "100. Years of Legacy_12_09_2020_220845.xlsb"), and is assigned in the variable "fileName". This .xlsb file has number of links from different source files and the file name attaches the time stamp (report dumped time) in it.

    The file is saved in a folder and I am looking to save it as a back up in a different folder on .xlsx format with the following requirements.

    1. Delete numeric characters in the left,
    2. Delete (".") after the numeric characters and trim " " (space character), and
    3. Break links with other source files.

    The output shall be "Years of Legacy_12_09_2020_220845.xlsx" with no links.

    Can you please advise me appropriate code to do this?

    Thank you,
    Roshan Shakya

  2. #2
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: Deleting characters assigned in the variable

    To update the file name, re-assign it to a string value, then manipulate the name and re-assign it. Something like this

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Deleting characters assigned in the variable

    Quote Originally Posted by Roshan.Shakya View Post
    ... file has number of links from different source files ...
    What type of links are these (formulas, functions, defined names, hyperlinks, embedded ole, from charts, etc.) ?
    Can you present their types ?

    Quote Originally Posted by Roshan.Shakya View Post
    ... the file name attaches the time stamp (report dumped time) in it ...
    What does this mean, can you explain ?

  4. #4
    Forum Contributor
    Join Date
    05-13-2019
    Location
    Halifax, Canada
    MS-Off Ver
    2016
    Posts
    176

    Re: Deleting characters assigned in the variable

    It's a formula link. The file name consists of time "12_09_2020_220845" (which is date and hours:minutes:seconds) and this part changes every time when a new report is dumped at a next date.
    Last edited by Roshan.Shakya; 09-28-2020 at 02:51 PM.

+ 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: 7
    Last Post: 06-20-2020, 01:55 AM
  2. [SOLVED] Assigned Variable contains a Formula. How do I make it so that it contains the value?
    By HamzaKhurram in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-01-2015, 12:16 PM
  3. [SOLVED] Change letters,characters and moves to an assigned number
    By sherryp5165 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-04-2013, 04:59 PM
  4. Replies: 2
    Last Post: 07-24-2012, 11:47 AM
  5. ListBox List function not allowing column argument when assigned to a variable
    By Brunstgnegg in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-24-2010, 04:05 AM
  6. Select some rows in a column assigned by a variable
    By kanuvas in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-01-2008, 04:57 AM
  7. Replies: 8
    Last Post: 08-08-2005, 09:05 PM

Tags for this Thread

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