How do I make this Code apply / work after saving and closing the Workbook?
Code:
' This Sub is automatically called when there is any change on this worksheet.
' If the change causes the value of any cell in column E to exceed 1, then the value of the
' the same cell in column H replaces the formula in that cell.
Public Sub Worksheet_Change(ByVal Target As Range) ' Check to see if the change occurred in column E If Target.Column = 5 Then ' Check to see if the change caused the value to go above 0 If Target.Value > 0 Then ' Assign the value of the corresponding cell in column B back to the cell as a value ' This is effectively the same as copy then "paste as value" Cells(Target.Row, 8).Value = Cells(Target.Row, 8).Value End If End If End Sub
Last edited by arthurbr; 06-10-2011 at 11:57 AM. Reason: Added code tags for OP
Hi and welcome to the board. Unfortunately,
Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
PLEASE PM WHEN YOU HAVE DONE THIS AND I WILL DELETE THIS POST
Quoting entire posts clutters the forum and makes threads hard to read !
If you are pleased with a member's answer then use the Star icon to rate it
Click here to see forum rules
I will do it for you this time, but please remember that code tags are important.
Before posting anew, check the forum rules first - Thx
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
Quoting entire posts clutters the forum and makes threads hard to read !
If you are pleased with a member's answer then use the Star icon to rate it
Click here to see forum rules
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks