for next loop

  1. C

    Probably the Easiest Question to Answer...

    So, I feel a little dumb asking this, but I've tried to work on it and figure it out all day to no avail, and I figure this is the quickest way to get an answer... I wrote this code on a machine running excel 2003 and everything seemed to work fine, but I brought it to my iMac at home running...
  2. G

    Error saying "Next without For" but I have (I think) the proper # of each.

    This code is looping through a range and looking for any cells that contain hyperlinks and then doing some other stuff. I keep getting the error "Next without For" when running my loop. You'd think this would be an easy error to find. Near the bottom of the code where is reads "Next...
  3. S

    Update label caption in for next-loop

    I have a UserForm with a label and a for next-loop and a command button. How can I update the label caption in my for next-loop? When I try updating with lblPercentage = i & "%" it does not update until the for next-loop is ended.
  4. S

    Advanced loop

    I am trying to make a loop which loops a total of 20 times with following output based on the two variables limit_x = 3 and limit_y = 4: <colgroup><col style="width:48pt" span="2" width="64"> </colgroup><tbody> x y 0 0 0 1 0 2 0 3...
  5. J

    Cell Address Help!

    How can you obtain the cell address of the cell being used in a "For Each Cell in Range("A1:A10") VBA statement (For Next code)?
  6. R

    VBA Data Validation populate error in For Next loop

    Can anyone explain why this code breaks on row 21,833 after working since row 8? Note: vntMatch is defined as variant and does not change. UsedRange is getting the proper row count (27,852) Dim vntMatch As Variant vntMatch = Application.Match("Manual", shtCashForecast.Range("7:7"), 0)...
  7. M

    Creating a For Next Loop

    Very new to VB and looking for some help on this basic problem. Thanks in advance. Trying to convert this code into a For Next Loop: X = 0 Do Until X = 33 X = X + 1 inst = Choose(X, "ASP", "CAL", "CCC", "CCI", "CCWF", "CEN", "CIM", "CIW", "CMC", "CMF", "COR", "CRC", "CTF"...
  8. J

    Restart a Loop from within an If statement?

    How to Restart Loop from begining when If statement is true? I am running a macro using a list of values in column A and using For and Next i to restart and loop through my data until the end of the list of data is reached.During the loop, I have If statements researching each value and if it...
  9. D

    How to give an array value to different comboboxes in vba excel?

    Hi, I have 4 comboboxes in a formcontrol (excel 2007, vba), each combobox has the name: Combobox_01 Combobox_02 Combobox_03 Combobox_04 I want to give all comboboxes the same array values "A","B","C","D","E","F" How do I do this efficiently?, I tried a For-NEXT loop, but I am not sure how to...
  10. S

    For.... Next Loop? Best way forward?

    Hi VBAers, As I delve deeper into excel I am learning many more exciting functions but am also coming up against many more problems! Is there a way to use a "for...next" loop in order to copy the below code 300 times? i.e. I have 300 different text boxes that are conditionally formatted...
  11. K

    For/Next Loop not working

    I'm pretty new to VBA, but just when I thought I was getting the hang of it, this nested For/Next loop will not work the way I want it to. Here is the code: Dim I As Integer Dim Count As Integer For Count = 0 To 7 For I = 1 To 8 Range("B2").Select...
  12. M

    For Next Loop on all Worksheets in Workbook Except the First

    I'm trying to figure out how to have a For Next loop run through all worksheets in a workbook besides the first one. Any ideas? I'd just run the macro starting from the first sheet and have it manipulate all the others after it. Here's my code for this loop part. For Each ws In...
  13. O

    'For .. Next' Problem

    Hi, My code loops through worksheets from 12 onwards and saves each as a separate file. I've used a For...Next loop to do this - this is the same one I've used in other macros and it works fine. However on this occasion, it won't stop at the final sheet; it tries to do another loop and therefore...
  14. L

    Hold the value of a variable until something else happens

    hello! I'm basically trying to write a code to do the concatenate at column C: <TABLE style="WIDTH: 326pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=433 border=0><COLGROUP><COL style="WIDTH: 16pt; mso-width-source: userset; mso-width-alt: 768" width=21><COL style="WIDTH...
  15. savindrasingh

    Increase limit of For loop during execution

    Hello Experts, Can any one please let me know how to increase the limit of FOR NEXT LOOP upper limit during execution of the loop? For example: If I am trying to execute a piece of code on list of items in a column and the number of items in the column are increased during execution based...
  16. Greg Truby

    Floating Point Error in For/Next Loop Counter

    Well, I'm glad this just happed to occur in something where it wasn't mission critical... Try this: Sub foo() For p = -1 To 1 Step 0.2 With Cells(1, (p + 1) * 5 + 1) .NumberFormat = "0%_);[Red](0%);0%" .Value = p End With Next p End Sub What do...
  17. B

    Loop through and change TextBox in UserForm

    I am working with a UserForm that has three sets of twenty TextBoxs that represent three different inputs that I will need for my spreadsheet. I would like to create a For...Next Loop that will look at each one and check a value in the spreadsheet, if the number of the TextBox is not greater...
  18. brettr87

    For Next Loop Trouble

    I'm sure this could be an easy fix for someone, but somehow this is escaping me at the moment... Dim AC Range("L6") = AC For AC = 0 To ActiveCell.Offset(RowOffset:=1) Next Sheets("15 mn bucket").Names.Add Name:="LEAD", RefersTo:=ActiveCell Sheets("15 mn bucket").Names.Add Name:="ChtVal"...
  19. P

    For Loop Taking Too Long

    Hi, I've got a sheet which I need to analyse and split into several different sheets but the raw data format leaves a lot to be desired as there are blank rows inserted randomly between rows of data. I need the 'good' data to stay in the same order so I've written a macro to sort through the...

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