Results 1 to 3 of 3

Enter Key = macro execution

Threaded View

  1. #1
    Registered User
    Join Date
    01-07-2016
    Location
    Brazil
    MS-Off Ver
    office 2010
    Posts
    2

    Question Enter Key = macro execution

    Hello guys, I have a problem. When I press the enter key to run my macro it works but only the cell A5 is active.

    This macro executed by enter key runs an advanced search on A5:G5. it may contain several criteria or just one but when I write on B5:G5 it does not work.

    The advanced search macro

    Public Sub Pesquisa()
    
    
     If ActiveCell.Row = 5 Then
        Sheets("PESQUISA").Select
        Sheets("basepes").Visible = True
        Sheets("PESQUISA").Select
        Sheets("basepes").Range("A1:L5900").AdvancedFilter Action:=xlFilterCopy, _
            CriteriaRange:=Range("PESQUISA!Criteria"), CopyToRange:=Range( _
            "PESQUISA!Extract"), Unique:=False
        Sheets("basepes").Select
        ActiveWindow.SelectedSheets.Visible = False
        Range("A5:L5").Select
        Selection.ClearContents
        Sheets("PESQUISA").Select
        Range("A5").Select
    End If
        
    End Sub
    The enter key macro

    Public Sub confpesq(ByVal Target As Range)
        If Target.Address = "$A$5:$G$5" Then
            Call Pesquisa
        End If
    End Sub
    Last edited by alansidman; 01-07-2016 at 09:46 AM. Reason: code tags added

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Pause Macro, move to another cell, continue macro execution
    By slotcardan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-04-2014, 08:23 PM
  2. [SOLVED] Slow Macro Execution
    By Gandalf2524 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-18-2013, 12:20 PM
  3. Messagebox prompt then allow user to enter data before continuing code execution
    By wazimu13 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-13-2013, 09:17 AM
  4. Hiding Macro Execution
    By dhatul in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-07-2010, 03:02 AM
  5. Problem with execution of a macro
    By pierre08 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-26-2010, 10:15 AM
  6. macro execution
    By ethyl in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-27-2008, 06:43 PM
  7. Macro execution time
    By Henry in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-08-2005, 11:05 AM
  8. [SOLVED] controlling macro execution
    By sree in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-20-2005, 10:06 PM

Tags for this Thread

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