Posts by StephenGP

    I'm in need of a VBA script that adds a value to match a corresponding list.


    Here is a before and after example of what I'm looking for.
    On Sheet1, I have 2 columns. Column A is a list of text / names, Column B is a value.


    Bob 20
    John 15
    Marry 6
    Trevor 3


    On Sheet2 I have another list of names, In Column A.


    Tom
    Sue
    Bob
    Jarred
    Marry
    Rick
    Trevor
    John


    I need VBA that will match their corresponding name in Column A and add the same value, from Sheet1 to Sheet2, Column B. ..... to look like the following:


    Tom
    Sue
    Bob 20
    Jarred
    Marry 6
    Rick
    Trevor 3
    John 15


    Thanks!

    I have this macro which calls a .bat file.

    Currently it's file specific. ( only calls a single file)


    Code
    Sub Bat_Vr01()
    Call Shell(Environ$("COMSPEC") & " /c D:\Projects\Tech\Run_Vr01.bat", vbNormalFocus)
    End Sub


    Is it possible to replace the bat file name "Run_Vr01.bat" with a cell address reference?

    As an example, to reference cell ("AK20"), which would contain the file name... Something like this:


    Code
    Sub Bat_Vr01()
    Call Shell(Environ$("COMSPEC") & " /c D:\Projects\Tech\ ("AK20") ", vbNormalFocus)
    End Sub


    Thanks!

    Thanks, Logit


    Although not quite what I was looking for.


    The script itself should not contain any path directories.

    I'm relying on the cells from Column A, and Column B to contain the path directory and file name.


    A script to essentially say:


    Copy all files listed from the directory path listed in column A

    Paste in the directory path listed in Column B

    Each row is assigned to their own unique path directory.


    from A1 to B1

    from A2 to B2

    from A3 to B3

    etc..


    Hope that helps..

    I'm attempting to copy files from one folder to another, based on a list. ( ie: Column A is the origin, column B is the destination folder)

    But I'd like the directory path to be incorporated in this list. ( not be part of the code itself.)


    An example, to move a list of files from the directory in column A to column B


    A..........................................................B


    C:\Test\Folder01\Image1.jpg........C:\Test\Folder02\

    C:\Test\Folder01\Image2.jpg........C:\Test\Folder02\

    C:\Test\Folder01\Image3.jpg........C:\Test\Folder02\


    Thanks for any help!

    I came across this code which copies and pastes without selecting.


    Code
    Sub CopyPaste1()
    Sheets("Sheet1").Range("B25").Copy Sheets("Sheet2").Range("B14")
    End Sub

    How can this be modified such that it copies the "active cell", instead of a range. ie: something like the example below ( which doesn't work)

    Code
    Sub CopyPaste2()
    Sheets("Sheet1").ActiveCell.Copy Sheets("Sheet2").Range("B14")
    End Sub

    Thank you RoyUK!


    Cheers!!

    In need of a Vba macro to rename folders from a list.

    As an example to have two columns in Sheet1 cells A & B

    Column A is the before name, Column B is the after.

    ..And if the folder doesn't exist, not to error ( do nothing)


    ie:


    A ....................................................... B

    C:\RenameTest\Folder1...... C:\RenameTest\Folder2


    Thank you for any help!