Results 1 to 3 of 3

Excel Programming

Threaded View

Joseph Mwambala Excel Programming 06-10-2011, 11:09 AM
arthurbr Re: Excel Programming 06-10-2011, 11:55 AM
arthurbr Re: Excel Programming 06-10-2011, 11:56 AM
  1. #1
    Registered User
    Join Date
    06-06-2011
    Location
    Kampala, Uganda
    MS-Off Ver
    Excel 2003
    Posts
    2

    Excel Programming

    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1