Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In the B9 cell I have values that they change dynamically.
Is possible , through VBA, than Excel notices of such variations and to every change writes those values in a text file with this structu DATE HOUR VALUE 10/30/2003 10:31 5,6 10/30/2003 11:59 5,9 10/31/2003 8:58 6 ETC. Can you help me? Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Assume this change is caused by some DDE connection
Look at SetLinkOnData property of the Workbook object to designate a macro to run when there is a change. Then have this macro write the data. In xl2000 and later, I believe you can use the change event for this. http://www.cpearson.com/excel/event.htm for a description of events. -- Regards, Tom Ogilvy "Matrix" wrote in message ... In the B9 cell I have values that they change dynamically. Is possible , through VBA, than Excel notices of such variations and to every change writes those values in a text file with this structu DATE HOUR VALUE 10/30/2003 10:31 5,6 10/30/2003 11:59 5,9 10/31/2003 8:58 6 ETC. Can you help me? Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Fri, 31 Oct 2003 14:51:18 -0500, "Tom Ogilvy"
wrote: Then have this macro write the data. In xl2000 and later, I believe you can use the change event for this. http://www.cpearson.com/excel/event.htm for a description of events. If it isn't very difficult, can you give me an exemple of vba code? I'm a novice Thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can get sample code he
http://support.microsoft.com/support...eio/fileio.asp File Access with Visual Basic® for Applications -- Regards, Tom Ogilvy Matrix wrote in message ... On Fri, 31 Oct 2003 14:51:18 -0500, "Tom Ogilvy" wrote: Then have this macro write the data. In xl2000 and later, I believe you can use the change event for this. http://www.cpearson.com/excel/event.htm for a description of events. If it isn't very difficult, can you give me an exemple of vba code? I'm a novice Thanks |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sat, 1 Nov 2003 11:48:27 -0500, "Tom Ogilvy"
wrote: You can get sample code he http://support.microsoft.com/support...eio/fileio.asp File Access with Visual Basic® for Applications Thanks for support. I've written this code, but it doesn't work. Can you tell me why? Sub Worksheet_Change(ByVal Target As Range) If Target.Value = Foglio2.Range("D9").Value Then MyTxtFile End Sub Sub MyTxtFile() Const Percorso = "c:\txtExport.txt" Open Percorso For Append As #1 Print #1, Date, Time, Cells(9, 4).Value Close #1 End Sub |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Target.Value would be the contents of D9. For the event to evaluate to true and run Mytexfile you have to give it the cell address so it knows which cell is the current cell. This way you can evaluate more than one cell. Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$D$9" Then mytxtfile End Sub Sub MyTxtFile() Const Percorso = "c:\txtExport.txt" Open Percorso For Append As #1 Print #1, Date, Time, Cells(9, 4).Value Close #1 End Sub -- John johnf202 at hotmail dot com "Matrix" wrote in message ... On Sat, 1 Nov 2003 11:48:27 -0500, "Tom Ogilvy" wrote: You can get sample code he http://support.microsoft.com/support...eio/fileio.asp File Access with Visual Basic® for Applications Thanks for support. I've written this code, but it doesn't work. Can you tell me why? Sub Worksheet_Change(ByVal Target As Range) If Target.Value = Foglio2.Range("D9").Value Then MyTxtFile End Sub Sub MyTxtFile() Const Percorso = "c:\txtExport.txt" Open Percorso For Append As #1 Print #1, Date, Time, Cells(9, 4).Value Close #1 End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Export range to text file | Excel Discussion (Misc queries) | |||
How to Export as text file with NO delimiters or modifications? | Excel Discussion (Misc queries) | |||
How can I export text from excel autoshapes to a text file? | Excel Discussion (Misc queries) | |||
Cell export to Text File? | Excel Discussion (Misc queries) | |||
Export excel file to semicolon delimited text file | Excel Discussion (Misc queries) |