+ Reply to Thread
Results 1 to 9 of 9

change target range to another worksheet

Hybrid View

  1. #1
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,659

    Re: change target range to another worksheet

    Do like oluapseyer suggests; copy the code to the sheet1 code module. And then also add a reference to the Report sheet like below.

    Private Sub Worksheet_Change(ByVal Target As Range)
        If Target = vbNullString Then Exit Sub
        If Target.Address = "$B$3" Then
            Application.EnableEvents = False
            fRow = Application.Match(Target, Sheets("Table").Columns(1), 0)
            If Not IsError(fRow) Then
                With Sheets("Report").Range("A" & Rows.Count).End(xlUp)
                    .Offset(1).Resize(, 4).Value = Sheets("Table").Cells(fRow, 1).Resize(, 4).Value
                    .Offset(1, 4) = Now()
                    .Offset(1, 5) = Environ("username")
                    .Offset(1, 6) = Sheets("Table").Cells(fRow, 5)
                End With
            Else
                MsgBox "Equipment not in the list"
            End If
            Application.EnableEvents = True
        End If
    End Sub
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  2. #2
    Forum Contributor
    Join Date
    09-30-2014
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    266

    Re: change target range to another worksheet

    Hi I tried that as well and the code is not triggering. I must have missed something out. I have attached the file for your review.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Worksheet Change Event adding formulas to target range not working
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-08-2017, 05:46 AM
  2. [SOLVED] Worksheet Change Target Ranges
    By Redled89 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-03-2016, 08:43 PM
  3. VBA - WorkSheet Change ByVal Target As Range and DDE link
    By from water in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-24-2013, 11:13 AM
  4. get cell value from worksheet change target
    By vangxbg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-06-2013, 06:07 PM
  5. [SOLVED] Change(ByVal Target As Range) does not work when Target value changes
    By LeonvL in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 01-07-2013, 06:59 PM
  6. Worksheet Change: Formula in Target Range
    By rhudgins in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-29-2010, 02:46 PM
  7. Worksheet Change Target??
    By spinkung in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-29-2009, 05:33 AM

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