next without for

  1. R

    Next without For

    Private Sub EnterButton_Click() Dim MyPoNum As Long Dim MyDate As Date Dim MyQty As Long Dim MyPNum As String Dim MyRow As Long Dim cmb As combobox, i As Integer For i = 1 To 10 Set cmb = Me.Controls.Item("ComboBox" & i) MyPoNum = Me.txt_PoNum.Value MyDate = Me.txt_Date.Value...
  2. D

    Macro Compile Error "Next without for"

    Hello everyone. I am having a problem with my macro. It is giving me a compile error "Next without for" when I added this line "If Sheet1.Cells(i, 9) = Active Then". It worked perfectly before I added I am sure I am just missing a simple line of text. Your help is much appreciated. Sub...
  3. K

    VBA - DueDate and Next Without For errors

    Hey guys, great forum, I've been using it a lot while doing this work in Excel. I am writing code to have Tasks in Outlook created by a huge list of tasks in an Excel document. I want to skip all the blank rows and rows of assignments that are already completed. So I am trying to make it so if...
  4. I

    My VBA keeps giving a next without for error... What am I missing. Brain fried today..

    Sub Format() Dim i As Long For i = 5 To 99 ' Can edit 99 to the maximum row number needed If ActiveSheet.Cells(i, 3).Value <> "" Then 'Referencing difference between column N and C. We want N to be less than or equal to 7 days from C. If ActiveSheet.Cells(i, 14).Value = ""...
  5. D

    Next Without For When Many If Statements

    Hi, I am looping through the different sheets in a workbook and filtering by different criteria depending on the value of two different strings. There are 36 possible combinations of these string values so I need many If..ElseIf statements. However, when I have the full code I get an error...
  6. D

    Next without for error

    Hey guys I have been pulling my hair out trying to figure out why I am getting a next without for compile error. I'm running Excel 2010 and believe I have looped my Do While statement, looped my For Next statement, and also closed my if statement. My simplified code block is below. What am I...
  7. A

    Compile Error: Next without For?

    Here is the code, for some reason I am getting a next without for error. What is wrong with it? Sub MeanCEOAge() ' ' MeanCEOAge Macro ' Dim TotalAge As Integer Dim CEOcount As Integer Dim i As Integer TotalAge = 0 CEOcount = 0 For i = 2 To 51 If Cells(i, 5).Value = "CEO" Then...
  8. L

    HELP - Next without For on PrintFormat Macro

    I have little knowledge of VBA. Below is a recording I did w/modifications. I want the print format to apply to all tabs in the workbook. It had worked on individual tabs so I added more "language" to make it apply to all the tabs but I think I just made it worse - see below, and now I'm...
  9. J

    For... Next VBA Problem

    Good morning all, I am trying to help my wife out with a little VBA. She got assigned this project for grad school and neither one of us have ever had a VBA class. Looking at this statement, can you see what is wrong. I get a Next without For errer on running it. I have rearranged it and tried...

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top