+ Reply to Thread
Results 1 to 2 of 2

Force condition on all Rows

  1. #1
    Registered User
    Join Date
    04-17-2006
    Posts
    13

    Force condition on all Rows

    Hi there,

    I am using the following code to print the system date and time in column 3 when the user types something in column 1. However this only ranges from row A2 to row A20.

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect([A2:A20], Target) Is Nothing Then
    Application.EnableEvents = False
    Cells(Target.Row, 3) = Now
    Application.EnableEvents = True
    End If
    End Sub

    I would like however, to set this condition for all of the column and not just rows 2 through 20.

    Any help would be greatly apreciated

    Aidan Mullane

  2. #2
    Chip Pearson
    Guest

    Re: Force condition on all Rows

    Change

    If Not Intersect([A2:A20], Target) Is Nothing Then

    to

    If Target.Column = 1 Then


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com



    "afmullane"
    <[email protected]> wrote in
    message
    news:[email protected]...
    >
    > Hi there,
    >
    > I am using the following code to print the system date and time
    > in
    > column 3 when the user types something in column 1. However
    > this only
    > ranges from row A2 to row A20.
    >
    > Private Sub Worksheet_Change(ByVal Target As Range)
    > If Not Intersect([A2:A20], Target) Is Nothing Then
    > Application.EnableEvents = False
    > Cells(Target.Row, 3) = Now
    > Application.EnableEvents = True
    > End If
    > End Sub
    >
    > I would like however, to set this condition for all of the
    > column and
    > not just rows 2 through 20.
    >
    > Any help would be greatly apreciated
    >
    > Aidan Mullane
    >
    >
    > --
    > afmullane
    > ------------------------------------------------------------------------
    > afmullane's Profile:
    > http://www.excelforum.com/member.php...o&userid=33567
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=533514
    >




+ Reply to Thread

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