I have a Macro that saves the excel field data to a .csv whenever I run the Macro. (see below)
The Macro does exactly what I need it to, however, I would like the Macro to run automatically every time the value in a specific field changes.
** I found this Macro online, I do not write code or know anything about VBA. Please "dumb-down" the explanation as simple as possible.
The Macro does exactly what I need it to, however, I would like the Macro to run automatically every time the value in a specific field changes.
** I found this Macro online, I do not write code or know anything about VBA. Please "dumb-down" the explanation as simple as possible.
Code:
Public Sub CharacterSV()
Const DELIMITER As String = ","
Dim myRecord As Range
Dim myField As Range
Dim nFileNum As Long
Dim sOut As String
nFileNum = FreeFile
Open "text.csv" For Output As #nFileNum
For Each myRecord In Range("A1:A" & _
Range("A" & Rows.Count).End(xlUp).Row)
With myRecord
For Each myField In Range(.Cells, _
Cells(.Row, Columns.Count).End(xlToLeft))
sOut = sOut & DELIMITER & myField.Text
Next myField
Print #nFileNum, Mid(sOut, 2)
sOut = Empty
End With
Next myRecord
Close #nFileNum
End Sub