Simple code but it isn't calling the macro.. no sure why. Called macro highlights error digits of Pi entered (Works).
![]()
Please Login or Register to view this content.
Simple code but it isn't calling the macro.. no sure why. Called macro highlights error digits of Pi entered (Works).
![]()
Please Login or Register to view this content.
Hi there,
You need to replace "Private Sub Pi_Entrd_Change(ByVal Target As Range)" with:
![]()
Please Login or Register to view this content.
Please note that the routine needs to be entered in the VBA CodeModule of the worksheet in question, not in a standard VBA CodeModule.
Hope this helps.
Regards,
Greg M
Thanks Greg.
I tried it and it did not work. That has me believing that I did not place the code into the worksheet properly as you mentions.
I am a newbie to this vba, and not sure how to place the code into the worksheet module other than right-clicking "This workbook":
VBAPRoject (Name of file)
Microsoft Excel Objects
Sheet1 (Pi)
Sheet2 (Pi_By_Pos)
Sheet3 (Pi_Keyd_In)
This workbook
Modules
Module1 (where my three (including this one we are discussing)
Module2 (Which is created by the right-click)
I Moved it to "ThisWorkbook" (by viewing code)
It is still not working.
I tried to upload the file but it is 300kb too large and I'm not allowed to upload a zip file.
Any suggestions for getting the file to you to assist you?
Hi again,
Thanks for your feedback.
The code needs to be inserted in the VBA CodeModule of the worksheet which contains the C13 cell you wish to monitor - i.e., CodeModule "Sheet1" or "Sheet2" or "Sheet3".
You can right-click on the tab of the worksheet in question, and then select "View Code" - this will open its VBA CodeModule, and you can then paste the code into it.
Hope this helps.
Regards,
Greg M
Did as asked and yes it went into the correct worksheet.
Upon changing the Pi_Entrd_String and pressing [Enter], it is not calling the routine.
I've uploaded the file to my google drive. If you give me an email, I can share the file with you.
Thanks - Sean
Email address sent to you via private message. Greg M
Hi again Sean,
Many thanks for that impressive workbook! I've modified it and emailed it back to you.
As you said, the workbook is too large to post here, but I'm posting the code solution in case anyone else has been following this thread.
I've inserted the required code in the VBA CodeModule of the "Pi_Keyd_In" worksheet.
The additional code is a bit more complicated than originally envisioned, because your code may cause the value of the target cell to change. This will give rise to a "chasing your tail" situation unless Events are disabled before your code is executed. However, if you disable Events, you must make sure that they are automatically re-enabled if an error condition should occur.
The following code is used:
![]()
Please Login or Register to view this content.
Hope this helps - please let me know how you get on.
Regards,
Greg M
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks