TkdKidSnake
Board Regular
- Joined
- Nov 27, 2012
- Messages
- 245
- Office Version
- 365
- Platform
- Windows
Hi all,
does anyone know how to copy VBA code from one workbook to another using VBA code and then for that code to run in the destination workbook?
The reason I need to do this is if the code is ran from the source workbook what its doing to the dates is quite bizarre however when its ran in the destination workbook all seems ok and when I compare the detail between the dates its realistic.
Source workbook = OTIF Dashboard.xlsm
Destination workbook = RawData.csv
The vba code is in module2 and is called "Sub RefreshData"
Below is the code
If anyone can help with this it would be greatly appreciated
Thanks in advance
does anyone know how to copy VBA code from one workbook to another using VBA code and then for that code to run in the destination workbook?
The reason I need to do this is if the code is ran from the source workbook what its doing to the dates is quite bizarre however when its ran in the destination workbook all seems ok and when I compare the detail between the dates its realistic.
Source workbook = OTIF Dashboard.xlsm
Destination workbook = RawData.csv
The vba code is in module2 and is called "Sub RefreshData"
Below is the code
Code:
Sub RefreshDates()'
' SelectRawData Macro
'
'
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Workbooks.Open Filename:= _
"P:\Public User Area\Quality\3 SUPPLIERS\Supplier OTIF\002 - RawData\RawData.csv"
'
'
Columns("P:S").Select
Application.CutCopyMode = False
Selection.NumberFormat = "m/d/yyyy"
'
Columns("P:S").Select
Selection.NumberFormat = "yyyy-mm-dd"
Application.DisplayAlerts = False
Application.ScreenUpdating = False
End Sub
If anyone can help with this it would be greatly appreciated
Thanks in advance