What i'm trying to do is have a macro that refers to a file location that is entered in Cell A2 of a specified sheet and stores that file location as a variable so that i can use the variable to open the file and copy data from the file.
Here's what i'm aiming to do as i currently have it without a variable. (this is not my full code but this short sample should be enough to show what i'm trying to do)
Workbooks.Open Filename:= _
"C:\Users\name\Desktop\Client\LIVE.csv" (want this to be a variable based on a file location that was entered in cell A2 of a seperate workbook)
Range("B10").Select
Selection.Copy
Windows("Book1").Activate
Range("B2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("LIVE.csv").Activate (want this to be based on the variable name)
Range("B11").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Book1").Activate
Range("B3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Here's what i'm aiming to do as i currently have it without a variable. (this is not my full code but this short sample should be enough to show what i'm trying to do)
Workbooks.Open Filename:= _
"C:\Users\name\Desktop\Client\LIVE.csv" (want this to be a variable based on a file location that was entered in cell A2 of a seperate workbook)
Range("B10").Select
Selection.Copy
Windows("Book1").Activate
Range("B2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("LIVE.csv").Activate (want this to be based on the variable name)
Range("B11").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Book1").Activate
Range("B3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False