L
longzoo
I have a PLC (programmable logic controller) linked to my PC and I'
using excel as an HMI. I have no education in VB but have managed t
figure enough out with a book and examples. now my problem... I have
cell in a workbook that changes from "true" to "false" every coupl
seconds. I also have a macro written that writes data from a cell to
memory location on the PLC. Heres where it falls apart
in sheet
under Microsoft Excel Objects I have the following code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Cells(14, 7) = True Then 'checks for flag (changes every
seconds)
Call Write_time
Else
Cells(8, 5).Interior.ColorIndex = 7 'for testing not needed!!
End If
End Sub
I put the Else in there to see if the macro was being run at all. Th
macro Write_time will only be called if I am entering text in th
worksheet and hit enter while cell (14,7) is true. If I save the macr
and watch the worksheet the cell (8,5) will not turn purple until
enter text and hit enter?!? I have been all over the web and throug
the "VB in 24 hours" book to no avail. ANY shove in the right directio
would be greatly appreciated
using excel as an HMI. I have no education in VB but have managed t
figure enough out with a book and examples. now my problem... I have
cell in a workbook that changes from "true" to "false" every coupl
seconds. I also have a macro written that writes data from a cell to
memory location on the PLC. Heres where it falls apart
in sheetunder Microsoft Excel Objects I have the following code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Cells(14, 7) = True Then 'checks for flag (changes every
seconds)
Call Write_time
Else
Cells(8, 5).Interior.ColorIndex = 7 'for testing not needed!!
End If
End Sub
I put the Else in there to see if the macro was being run at all. Th
macro Write_time will only be called if I am entering text in th
worksheet and hit enter while cell (14,7) is true. If I save the macr
and watch the worksheet the cell (8,5) will not turn purple until
enter text and hit enter?!? I have been all over the web and throug
the "VB in 24 hours" book to no avail. ANY shove in the right directio
would be greatly appreciated
