+ Reply to Thread
Results 1 to 2 of 2

Help to modify this code

  1. #1
    Registered User
    Join Date
    12-26-2010
    Location
    Ohio
    MS-Off Ver
    Excel 2003 and 07
    Posts
    16

    Help to modify this code

    I have this code that works great to double click data from sheet 1 to sheet 2 and so on. Can I modify this again to work with 2 different work books? Can I open one work book (say item numbers) and a 2nd work book (say blank order form) and have the one move double clicked data to the other work book? Thanks

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Not Intersect(Target, Sheets(1).Range("A1:A100")) Is Nothing Then
    MsgBox "You just clicked on " & Target.Address
    Sheets(2).Range("A1").Value = Target.Value
    End If
    If Not Intersect(Target, Sheets(1).Range("B1:B100")) Is Nothing Then
    MsgBox "You just clicked on " & Target.Address
    Sheets(2).Range("B1").Value = Target.Value
    End If
    End Sub

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Help to modify this code

    Four posts & three rules broken. Either read the Forum Rules & follow them or don't bother posting.

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Last edited by royUK; 12-28-2010 at 07:09 AM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ 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