Event Handling Code
Find bottlenecks in your Excel workbooks
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 7 of 7

Thread: Event Handling Code

  1. #1
    New Member Geronimo's Avatar
    Join Date
    Mar 2002
    Location
    Toledo, OH
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I'm writing an Excel macro to copy a range from one worksheet in a workbook to another sheet in the same workbook. I'm having trouble recalling how to write some event handling code. I ideally wish to trigger the range copying when I enter a value in the last cell in the range on the first worksheet. I would settle for another method if my ideal method is not possible. Thank you for your kind help & prompt reply.

  2. #2
    MrExcel MVP
    Colo's Avatar
    Join Date
    Mar 2002
    Location
    Kobe, Japan
    Posts
    1,456
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Geronimo.








    A B C
    1data_A1data_B1data_C1
    2data_A2data_B2data_C2
    3data_A3data_B3data_C3
    4data_A4data_B4data_C4
    5data_A5data_B5data_C5

    If last cell is C5 like above.


    '//Please copy this into sheet module of "first worksheet"
    Private Sub Worksheet_Change(ByVal Target As Range)
    With Range("C5")
    If Application.Intersect(.Item(1), Target) Is Nothing Then Exit Sub
    .CurrentRegion.Copy Sheets("Sheet2").Range("A1") 'Change Sheet2 to name of another sheet
    End With
    End Sub

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hey Colo?
    How did you get the image of the worksheet into your message?
    Great tool to help other!
    First I have seen it...
    Thanks
    Tom

  4. #4
    New Member Geronimo's Avatar
    Join Date
    Mar 2002
    Location
    Toledo, OH
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks, I'll give it a try to see how it works. I appreciate the quick reply!

    [ This Message was edited by: Geronimo on 2002-03-30 07:47 ]

  5. #5
    MrExcel MVP
    Colo's Avatar
    Join Date
    Mar 2002
    Location
    Kobe, Japan
    Posts
    1,456
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi. TsTom,
    This time I only wrote HTML in my reply.
    >Great tool to help other!
    But I have an excel tool that is Japanese version.

    http://qchan.hornet.co.jp/Qchan/Tomo...ft/default.asp
    0019 table converter(ver2.1)
    0019「テーブルこんばーた(Ver. 2.1)」

    A person who made it is my friend, so I ask her if possible make a English version.

    regards,

  6. #6
    New Member Geronimo's Avatar
    Join Date
    Mar 2002
    Location
    Toledo, OH
    Posts
    18
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    It didn't work Colo. I filled in the range & sheet names to match my spreadsheet, but to no avail. I'll keep trying, unless you have another suggestion. Thanks for you kind help!

  7. #7
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks Colo, I appreciate it!
    Tom

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

DMCA.com