J
Jim333
Hi everybody,
My question is about using the application SendKeys with IF inside VBA,
I have a table contains twenty rows and five columns (File Attached),
what I want is that when any of the twenty cells in column "C" is not
blank, Then: By using the application SendKeys, the current date should
be inserted in the opposite cell in column "D".
I have created a code for that purpose, but it did not work properly,
so I wish I could find the answer in this wonderful site.
And this is the code I have created:
PRIVATE SUB WORKSHEET_CHANGE(BYVAL TARGET AS RANGE)
IF RANGE("C" & TARGET.ROW).VALUE <> "" THEN
RANGE("D" & TARGET.ROW).VALUE = APPLICATION.SENDKEYS("^;")
EXIT SUB
END IF
END SUB
+-------------------------------------------------------------------+
|Filename: SendKeys.zip |
|Download: http://www.excelforum.com/attachment.php?postid=3695 |
+-------------------------------------------------------------------+
My question is about using the application SendKeys with IF inside VBA,
I have a table contains twenty rows and five columns (File Attached),
what I want is that when any of the twenty cells in column "C" is not
blank, Then: By using the application SendKeys, the current date should
be inserted in the opposite cell in column "D".
I have created a code for that purpose, but it did not work properly,
so I wish I could find the answer in this wonderful site.
And this is the code I have created:
PRIVATE SUB WORKSHEET_CHANGE(BYVAL TARGET AS RANGE)
IF RANGE("C" & TARGET.ROW).VALUE <> "" THEN
RANGE("D" & TARGET.ROW).VALUE = APPLICATION.SENDKEYS("^;")
EXIT SUB
END IF
END SUB
+-------------------------------------------------------------------+
|Filename: SendKeys.zip |
|Download: http://www.excelforum.com/attachment.php?postid=3695 |
+-------------------------------------------------------------------+