Results 1 to 16 of 16

Worksheet_Selection Change problem

Threaded View

  1. #1
    Forum Contributor
    Join Date
    07-11-2009
    Location
    NYC,USA
    MS-Off Ver
    Excel 2007
    Posts
    135

    Worksheet_Selection Change problem

    Hi folks,

    I wrote this code which allows me to:
    -- enter the DATE, then have the DESIGNATION column fill in automatically.
    -- enter the CHARGE amount and have the CREDITS column fill in $0.00, giving me the option to
    overwrite it if there is an actual credit to be posted.

    I would like to run the "Clear_NONFOODS" macro w/o having zero's replaced everywhere,
    and to be able to Right Click and Clear Contents w/o the having the same problem.
    I'm wondering if there is a better way to achieve this?

    Is it possible to also have DESIGNATION columns clear if the TARGET cell is cleared?
    (This column will be hidden . It is used primarily for sorting when combined with other sheets on to a TOTALS page)

    Private Sub Worksheet_Change(ByVal Target As Range)
       On Error Resume Next
       If Range("NONFOOD_DATES", "NONFOOD_CHARGES") Is Nothing Then Exit Sub
        On Error GoTo 0
    
    If Not Intersect(Target, Range("NONFOOD_DATES")) Is Nothing Then
      Application.EnableEvents = False
            Target.Offset(0, 1).Value = "Amex-NonFoods"
            Application.EnableEvents = True
    End If
    
    If Not Intersect(Target, Range("NONFOOD_CHARGES")) Is Nothing Then
      Application.EnableEvents = False
            Target.Offset(0, 1).Value = "0"
            Application.EnableEvents = True
    
    End If
    End Sub
    I’ve included a workbook for inspection.

    Thanks!
    Attached Files Attached Files
    Last edited by max57; 03-04-2010 at 06:17 PM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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