+ Reply to Thread
Results 1 to 3 of 3

Apply Excel Program to a Number of Rows

  1. #1
    Carlton
    Guest

    Apply Excel Program to a Number of Rows

    Hello all,

    With the help of various people from this group I have managed to come
    up with an excel program that appears to work for me. However, the
    program applies to one row and I need it to work with a number of rows
    without having to write out individual cells. Can someone please show
    me how to acheive it? I have attached the program below.

    Cheers

    Carlton

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Me.Range("A1") > Me.Range("E1") And _
    Me.Range("B1") > Me.Range("F1") And _
    Me.Range("C1") > Me.Range("G1") Then
    MsgBox "Damn it"
    End If
    End Sub

  2. #2
    papou
    Guest

    Re: Apply Excel Program to a Number of Rows

    Hi
    You may use the Target.Row property, ie:
    r = Target.Row
    Range("A" & r)

    HTH
    Cordially
    Pascal

    "Carlton" <[email protected]> a écrit dans le message de news:
    [email protected]...
    > Hello all,
    >
    > With the help of various people from this group I have managed to come
    > up with an excel program that appears to work for me. However, the
    > program applies to one row and I need it to work with a number of rows
    > without having to write out individual cells. Can someone please show
    > me how to acheive it? I have attached the program below.
    >
    > Cheers
    >
    > Carlton
    >
    > Private Sub Worksheet_Change(ByVal Target As Range)
    > If Me.Range("A1") > Me.Range("E1") And _
    > Me.Range("B1") > Me.Range("F1") And _
    > Me.Range("C1") > Me.Range("G1") Then
    > MsgBox "Damn it"
    > End If
    > End Sub




  3. #3
    Carlton Patterson
    Guest

    Re: Apply Excel Program to a Number of Rows

    Papou,

    Thanks for responding, however I guy called Harald has just solved the
    problem for me.

    Thanks anyway mate.


    Cheers

    Carlton

    *** Sent via Developersdex http://www.developersdex.com ***

+ 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