+ Reply to Thread
Results 1 to 3 of 3

Recorded macro not fully working

  1. #1
    Registered User
    Join Date
    05-31-2014
    Posts
    2

    Question Recorded macro not fully working

    Dear All,

    Please see that I have recorded a macro in my excel file and saved it. Then I created a command button in the excel sheet and assigned that macro to it. But I am surprised to see that only a part of the macro is working. The VBA code is pasted below;

    Range("A2:B3").Select
    Range(Selection, Selection.End(xlDown)).Select
    Range("A2:B100").Select
    Selection.ClearContents
    Range("A2").Select
    Sheets("BRANDY").Select
    ActiveSheet.Range("$IB$3:$II$164").AutoFilter Field:=3, Criteria1:=">0", _
    Operator:=xlAnd

    ' IT ONLY WORKS UP TO HERE. THE BELOW PART IS NOT SEEMS TO WORK

    Range("IB4:IB18").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.SpecialCells(xlCellTypeVisible).Select
    Selection.Copy
    Sheets("Sheet2").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Sheets("BRANDY").Select
    ActiveWindow.ScrollRow = 114
    ActiveWindow.ScrollRow = 3
    Range("ID4:ID18").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.SpecialCells(xlCellTypeVisible).Select
    Application.CutCopyMode = False
    Selection.Copy
    Sheets("Sheet2").Select
    Range("B2").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Range("A2:B2").Select
    Range(Selection, Selection.End(xlDown)).Select
    Application.CutCopyMode = False

    Can anybody help me provide any solution? Thanks is Advance

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Recorded macro not fully working

    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file and a mocked up solution.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Recorded macro not fully working

    Hi jsatekm
    If the following does not work for you, it is because you have some important detail that you have not described but that is relevant for the purposes of this filtering.

    In this case, you should upload your sample workbook to the Forum to see what happens:

    PHP Code: 
    Sub Macro8()
    Cells(1).CurrentRegion.Resize(, 2).Offset(1).ClearContents
    With Sheets
    ("BRANDY")
      [
    a3] = "=" & .[id4].Address(00external:=True) & ">0"
      
    .Range("IB3,ID3").Copy [a4]: .Range("IB3").AutoFilter
      
    .Range("IB3", .Cells(Rows.Count"ID").End(xlUp)).AdvancedFilter 2Range("A2:A3"), Range("A4:B4"), False
    End With
    Range
    ("A2:B4").Delete xlShiftUp
    End Sub 
    You are always very welcome if you add reputation by clicking the * (bottom left) of each message that has helped you.

+ 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. Recorded Macro Problem: Inconsistently Working :(
    By wedzmer in forum Excel General
    Replies: 19
    Last Post: 09-26-2016, 12:33 AM
  2. Find and Replace Recorded Macro Not Working
    By james213r in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-17-2015, 12:53 PM
  3. [SOLVED] Just recorded Macro not working
    By Trevasaurus in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-07-2015, 03:16 PM
  4. [SOLVED] Why is my Simple Recorded Macro not working?
    By andrew93hughes in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-27-2013, 08:49 AM
  5. Replies: 0
    Last Post: 06-29-2011, 04:53 AM
  6. Recorded Macro not Working Properly
    By ilias in forum Excel General
    Replies: 1
    Last Post: 07-15-2010, 09:47 AM
  7. VB code request for a Working Recorded Macro
    By hsmeet in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-30-2007, 11:40 AM

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