+ Reply to Thread
Results 1 to 3 of 3

Del char to the left of symbol macro

  1. #1
    Registered User
    Join Date
    06-08-2011
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2007
    Posts
    2

    Del char to the left of symbol macro

    I am copy/paste directory locations, containing files as well as their size and last update time into a spreadsheet from word. I need a macro that will allow me to delete all the characters up to the "\\" of the directory as well as to delete the date, time, and file size of its contents and move that file name to the neighboring column. Example below:


    Directory of \\imadcfs\d$\

    06/20/2007 06:59 PM 9,991 StageFile.pl
    6/06/2007 05:46 PM 9,899 bs1.pl
    1 File(s) 9,991 bytes

    to...

    \\imadcfs\d$\ | StageFile.pl
    (Column A | Column B)

    I recorded a macro, clicked "relative" but it when I run it, it will change the file name and directories to those of the recorded macro.

    Thanks!

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Del char to the left of symbol macro

    Macro, ..., please!
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    06-08-2011
    Location
    Charlotte, NC
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Del char to the left of symbol macro

    Sub Del_Shift()
    '
    ' Del_Shift Macro
    '
    ' Keyboard Shortcut: Ctrl+a
    '
    ActiveCell.FormulaR1C1 = "\\imcltfscas1\d$\Finance\scripts"
    ActiveCell.Offset(2, 0).Range("A1").Select
    ActiveCell.FormulaR1C1 = "12,943 DnTzip.pl"
    ActiveCell.Offset(1, 0).Range("A1").Select
    ActiveCell.FormulaR1C1 = "fihub_run_promet.pl"
    ActiveCell.Offset(1, 0).Range("A1").Select
    ActiveCell.FormulaR1C1 = "mycopy.pl"
    ActiveCell.Offset(-2, 0).Range("A1").Select
    ActiveCell.FormulaR1C1 = "DnTzip.pl"
    ActiveCell.Range("A1:A3").Select
    ActiveCell.Offset(2, 0).Range("A1").Activate
    Selection.Cut Destination:=ActiveCell.Offset(-4, 1).Range("A1:A3")
    ActiveCell.Offset(-4, 1).Range("A1:A3").Select
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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