+ Reply to Thread
Results 1 to 4 of 4

Run macro when data based on cell value that is pasted and not typed in

  1. #1
    Registered User
    Join Date
    02-08-2012
    Location
    manila, philippines
    MS-Off Ver
    Excel 2003
    Posts
    9

    Run macro when data based on cell value that is pasted and not typed in

    Hello everyone,

    I'm trying to run a macro with worksheet_change but I can't quite get it to work the way I wanted to.

    I would copy the data from sheet 1 then paste it to sheet 2. The value in C1 in sheet 2 would be used to filter the data available in sheet 3 and to select a designated value in sheet 4 (basically a directory that would point me to).

    If I type in the value in C1 in sheet 2 the macro works just fine however what i'm doing is copying the data from sheet 1 and the pasting it.

    Here's what I have so far. It only does something to sheet 3 and I haven't started on sheet 4 yet.


    Private Sub Worksheet_Change(ByVal Target As Range)

    If Target = Range("C1") Then

    Sheets("Sheet 3").AutoFilterMode = False
    Sheets("Sheet 3").Columns("B").AutoFilter Field:=1, Criteria1:=Range("C1").Value, Operator:=xlOr, Criteria2:="Dept"

    End If

    End Sub

    Thanks!

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Run macro when data based on cell value that is pasted and not typed in

    Moderation removed.

    Code Tags added.
    Last edited by Winon; 03-02-2016 at 01:48 PM.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Registered User
    Join Date
    02-08-2012
    Location
    manila, philippines
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Run macro when data based on cell value that is pasted and not typed in

    Apologies for the non compliance.

    Here's the code.

    Any help is greatly appreciated.

    Please Login or Register  to view this content.

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Run macro when data based on cell value that is pasted and not typed in

    Hello original,

    I am a bit confused with your explanation about the sequence of events from Sheet1 through Sheet4.

    Will the code below help you working it out your way?

    Please Login or Register  to view this content.
    Regards

+ 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] Highlighting a cell based on the date typed in another cell of a different location
    By Anuru in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-18-2014, 04:20 AM
  2. Can Macros be set to automatically run when something is pasted or typed into a cell?
    By Lylestyle89 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-25-2013, 09:06 PM
  3. Insert Picture based on what is typed in Cell?
    By Mile029 in forum Excel General
    Replies: 1
    Last Post: 04-19-2013, 06:10 AM
  4. Replies: 4
    Last Post: 12-12-2012, 03:03 PM
  5. Replies: 9
    Last Post: 02-14-2011, 10:04 PM
  6. VBA Output based on what's typed into Cell.
    By samhale in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-09-2008, 05:38 PM
  7. Coloring Cell based on typed information
    By Jonker19 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-19-2005, 09:50 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