Hi All, Let me start by saying that I'm not very good at macros or VBA.
I have the following code which opens a CSV file named 1a.csv (which is in C:\CSVToday) and copies range A4 : G2000 to my current workbook
What I'm trying to achieve is:
Once the macro is triggered then it asks me where and what the file to copy the range from
Once it has copied the range (into my currently opened workbook), then it closes the file without saving any changes
In the future, the file being copied will be an excel file and not a CSV. (but won't contain any formulas or formatting), I just want to copy values.
Would really appreciate any help
Sub Open1A_CopyData()
'
' Open1A_CopyData Macro
Workbooks.Open "C:\CSVToday\1a.csv"
Workbooks("1a.csv").Sheets("1a").Range("A4:G2000").Copy
ThisWorkbook.Sheets("TodaysData").Range("C4").PasteSpecial Paste:=xlPasteValues
ActiveWindow.WindowState = xlMinimized
Range("A1").Select
MsgBox ("Data Has Been Updated")
End Sub
I have the following code which opens a CSV file named 1a.csv (which is in C:\CSVToday) and copies range A4 : G2000 to my current workbook
What I'm trying to achieve is:
Once the macro is triggered then it asks me where and what the file to copy the range from
Once it has copied the range (into my currently opened workbook), then it closes the file without saving any changes
In the future, the file being copied will be an excel file and not a CSV. (but won't contain any formulas or formatting), I just want to copy values.
Would really appreciate any help
Sub Open1A_CopyData()
'
' Open1A_CopyData Macro
Workbooks.Open "C:\CSVToday\1a.csv"
Workbooks("1a.csv").Sheets("1a").Range("A4:G2000").Copy
ThisWorkbook.Sheets("TodaysData").Range("C4").PasteSpecial Paste:=xlPasteValues
ActiveWindow.WindowState = xlMinimized
Range("A1").Select
MsgBox ("Data Has Been Updated")
End Sub