+ Reply to Thread
Results 1 to 3 of 3

Can't Find Formula in Macro

  1. #1
    Registered User
    Join Date
    06-09-2020
    Location
    USA
    MS-Off Ver
    2016
    Posts
    27

    Can't Find Formula in Macro

    I apologize, but I cannot find a formula that pulls during the running of the report. I have looked over the code and view macro items but have not been able to find it. Please assist and help me find it as it needs to be A2 instead of B2. It pulls the following: =IFERROR(VLOOKUP(B2, roster, 3, FALSE),"zzERROR"). Please see below.


    Sub Run_Report()
    '
    ' Run_Report Macro
    '
    ' Keyboard Shortcut: Ctrl+r
    '
    ' Below cleans up in brings in raw report

    Workbooks.Open Filename:= _
    "Report Name location (private)"
    Range("A1").Select
    Range(Selection, Selection.End(xlToRight)).Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Copy
    Windows("Report Name.xlsm").Activate
    Range("A1").Select
    ActiveSheet.Paste
    Windows("Reference Report Name.xlsx").Activate
    Range("A1").Select
    ActiveWindow.Close


    'Below pulls roster

    Workbooks.Open Filename:= _
    "Report 2 Name.xlsm"
    Sheets("Sheet1").Activate
    Columns("A:E").Copy
    Windows("Report Name.xlsm").Activate
    Sheets("Roster").Range("A1").PasteSpecial xlPasteValues
    Range("A1").Select
    Sheets("Roster").Range("A2:E1000").ClearFormats
    Sheets("Final").Select
    Application.CutCopyMode = True
    Windows("Report 2 Name.xlsm").Activate
    Range("B1").Select
    ActiveWindow.Close
    Columns("J:K").Select
    Selection.Delete Shift:=xlToLeft

    'Below sorts specialists alphabetically

    With Sheets("Final")
    If Not .AutoFilterMode Then .Range("A:J").AutoFilter
    .Range("A:J").EntireColumn.AutoFit
    .AutoFilter.Sort.SortFields.Clear
    .AutoFilter.Sort.SortFields.Add Key _
    :=Range("J1:J15000"), SortOn:=xlSortOnValues, Order:=xlAscending, _
    DataOption:=xlSortNormal
    With .AutoFilter.Sort
    .Header = xlYes
    .MatchCase = False
    .Orientation = xlTopToBottom
    .SortMethod = xlPinYin
    .Apply
    End With
    End With

    End Sub
    Sub Macro4()
    '
    ' Macro4 Macro
    '

    '
    With Sheets("Final")
    If Not .AutoFilterMode Then .Range("A:J").AutoFilter
    .Range("A:J").EntireColumn.AutoFit
    .AutoFilter.Sort.SortFields.Clear
    .AutoFilter.Sort.SortFields.Add Key _
    :=Range("J1:J15000"), SortOn:=xlSortOnValues, Order:=xlAscending, _
    DataOption:=xlSortNormal
    With .AutoFilter.Sort
    .Header = xlYes
    .MatchCase = False
    .Orientation = xlTopToBottom
    .SortMethod = xlPinYin
    .Apply
    End With
    End With
    End Sub

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Can't Find Formula in Macro

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    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,532

    Re: Can't Find Formula in Macro

    Few problems ...

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional.)


    Administrative Note:

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Please see Forum Rule #2 about code tags and adjust accordingly. Click on Edit to open your post, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional.)


    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    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


+ 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. Can we make this macro find the results of a formula?
    By ghostbroker2 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-12-2018, 07:06 PM
  2. [SOLVED] Macro that will find all times and add this formula
    By g1terra in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-28-2017, 02:24 PM
  3. Macro to find first row blank row then write in a formula
    By jbeets in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-30-2016, 03:34 PM
  4. [SOLVED] Macro find replace in formula
    By LucieG in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-19-2015, 03:54 PM
  5. MACRO help: where to find prewritten macro or formula
    By MAXCAT2007 in forum Excel Programming / VBA / Macros
    Replies: 38
    Last Post: 04-17-2014, 08:13 AM
  6. Replies: 3
    Last Post: 10-31-2012, 01:14 PM
  7. [SOLVED] Macro to find formula Error and add names to another tab
    By dave1983 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-10-2012, 09:03 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