No Cells Were Found Error when Macro is Run

Jett Midknight

Board Regular
Joined
Jan 8, 2014
Messages
110
So when I go to run a macro, it won't run at all, and I keep getting a "No Cells Were Found" pop up. I'm not sure why, seeing as how this macro worked fine yesterday. I tried stepping through the macro to find where it fails at, and it goes through the entire macro fine without any errors, yet when I try to run the entire macro, it fails. Any idea why> I am running Excel 2010. I have searched all over the web and forums trying to find an answer to this issue, and I have fouund nothing.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
I think we would need to see your code to see what it is doing (i.e. is it doing some sort of Search/Find)?
Please post your code here.
 
Upvote 0
I really think you need to post your code else I suspect nobody is going to be able to help you
 
Upvote 0
Sorry, I didn't want to post all of my code because I didn't think it was a problem with the code itself. The code is long, so here is the main part of it. The With and End With statements can be ignored for the most part.

Code:
 ActiveSheet.ShowAllData    ActiveSheet.Range("$A$2:$BD$5000").AutoFilter Field:=3, Criteria1:= _
        "Order Filled"
    Rows("2:2").Select
    r = Selection.Row
    Cells(r + 1, 1).EntireRow.Insert
    Rows("3:3").Select
    With Selection.Interior
        .Pattern = xlNone
        .TintAndShade = 0
        .PatternTintAndShade = 0
    End With
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlInsideVertical)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlInsideHorizontal)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    Selection.Font.Bold = False
    
    Dim nrows As Long
    nrows = Cells(Rows.Count, "H").End(xlUp).Row


    Range("I3").FormulaR1C1 = "Order Filled"
    Range("J3").FormulaR1C1 = "Order FIlled"
    Range("I3:J3").Copy Range("I3:J" & nrows)
    Rows("3:3").EntireRow.Delete
    ActiveSheet.ShowAllData
 
Upvote 0
Do you know on which line the error occurs?
Sometimes, when you get an error message, you get a Debug option. If you click that, it will highlight the row causing the error.
Otherwise, you can use F8 to step through your code line-by-line and see exactly when/where the error occurs.
Could you do that and let us know what line is causing issues?
 
Upvote 0
Do you know on which line the error occurs?
Sometimes, when you get an error message, you get a Debug option. If you click that, it will highlight the row causing the error.
Otherwise, you can use F8 to step through your code line-by-line and see exactly when/where the error occurs.
Could you do that and let us know what line is causing issues?

As per my original post
I tried stepping through the macro to find where it fails at, and it goes through the entire macro fine without any errors

This is why am I so puzzled, as I'm not sure how no line can cause an error, but the macro still won't run.
 
Upvote 0
Sorry, in the time lapse I didn't go back and read your first post after the first and forgot that you mentioned that.

Is it actually an error message (with a Debug option) that pops up, or some sort of message box?
If it is a Message Box, I do not see one in your code, so that tells me maybe a different macro is running.

Confirm the following:
1. Are you running the right macro?
2. Is it running on the correct sheet?
 
Upvote 0
It isn't an error box from VBA that prompts a debugger, it appears to be a message from Excel itself. I have attached the picture below.


nRKwYXP.png


1. Yes, I am quit sure I am running the right macro.
2. Since the macro never specifies a specific sheet does it matter what sheet I try and run it on? The macro itself is stored in my Personal workbook
 
Upvote 0
Since the macro never specifies a specific sheet does it matter what sheet I try and run it on? The macro itself is stored in my Personal workbook
If that is the case, you just need to make sure that the sheet you wish to apply it to is the "active" sheet when the macro is run.
 
Upvote 0

Forum statistics

Threads
1,215,030
Messages
6,122,762
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top