do while loop

  1. N

    How do i put the last value of a loop from a vba program into a cell in excel

    i have a do while loop w a nested if statement, it is for iterations for the bisection method for finding the root of an eq. i woud like to know how to put the last iteration in cell C2 please an thank you
  2. VBE313

    How can i replace this "a" without application ran code?

    How can i replace the bold part? Function test1234() Dim a As Long If ActiveSheet.Name = "Sheet1" Then Else End If a = Application.Caller.Row + 1 Do While Cells(a, 1).Value <> "Yes" If Cells(a, 2) = "Yes" Then Exit Do test1234 = test1234 + Val(Cells(a, 2).Value)...
  3. T

    Looping in a loop exit issue

    I am working on a loop which functions as intended exceptfor the conditional expression and which keeps looping. Ibelieve it maybe my method of assigning the conditional expressions “Do While TAIPlan = TAIPlan2”..” IfTAIPlan <> TAIPlan2 Then Exit Do”. Basically I’m trying to compare one...
  4. K

    Using a Do while loop, sum all the even numbers from 0 to the number entered.

    I need help writing a sub that asks the user for a positive integer less than 100. Using a Do While loop sum all the even numbers from 0 to the number entered. Display the results of this calculation in a MsgBox. Assume 0 is an even number. Check to be sure that the number is within the...
  5. G

    Error in Do While strF <> vbNullString Loop

    When I run a macro , macro has to open work book in specified folder and apply formula then save as text file.once compled goto the next file in the folder but when I run the macro its showing error "Run-time error '5': Invalid procedure call or argument" after first file is processed error in -...
  6. J

    Super Duper Concatenate Question

    Greetings All, I hope someone can help, I have a monthly report which it delivered in Excel but I then need to change it. Here is what I get: A B 500234 Tom Sarah Joan 299355 Peter William Mary...
  7. B

    VBA Macro - Do While trouble

    Hey guys, I have a macro that I want to keep doing over and over until I change a the value in A7 I have worked out the action of the Macro (rotating pages) But I am stuck with the Do While Here is my code, thanks in advance for the help Sub Rotating()Application.OnTime Now +...
  8. K

    VBA Code for Transcribing Data

    I am trying to write a Macro that will autofill another spreadsheet based on the weight of product A that I have. For example, I have 6000 lbs of Product A with order number 456ABC. I want to write code that will look at the weight (6000) and knowing that each bag weighs 100 pounds, autofill...
  9. T

    If statement inside of Do While Loop

    I am trying to perform a loop through a file folder and pull all of the file names and paste them in my range EXCEPT I want it to skip all files that have Zero Reading in the name. Any help? In my code below I cannot get the If statement to skip all file names containing "Zero Reading" in the...
  10. V

    Continue to next iteration in Do While Loop

    Hello, I am trying to update files of one of specific folder. I am using Do While loop to update these files. But I want to add condition. If in these excel files there is particular sheet with previous month name then loop should skip that file & move to next. I am not even amateur in VBA...
  11. K

    Skipping a line in Excel Macro if it fails to meet a condition

    Hi All! First time posting to the board. I've looked all over to find an answer to this, but nothing seems to fit my needs. To set up the problem, I have two worksheets (same workbook). One sheet has the raw data, and the second sheet has the processed data. The data that is placed in the raw...
  12. M

    Moving Rows to Other Sheets Based on Values in the First Column?

    I'm new to Excel Macros but not to programming. I have some training in C, C++, IDL and HTML. However, I'm still muddling about trying to get a handle to the syntax and capabilities of VBA. As far as my question is concerned, I have a master sheet with 22 columns of data. Time, a categorical...
  13. B

    hexadecimal calculator using Do Until-loop and select case

    I am trying to write a macro that converts a decimal number into a hexadecimal using Do Until-loop and select case here is what I have so far when I run it the computer freezes up Sub HexConverter() Dim L As Double Dim K As Integer Dim N As Double Dim R As Double Dim A As Double Dim P As...
  14. V

    Help making a Do-While loop... Loop

    Hi all, I'm having trouble making this loop iterate: Do While Cells(96, DtlNxtCol + 2).Value > 0 Sheets("Detail_Sheet").Select Cells(10, DtlNxtCol).Copy Sheets("Summary").Select Cells(SumNxtRow, 1).Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone...
  15. J

    Do While Loop using output from Input Box as criteria

    OK. I’m stuck. I’m trying to do a “Do While Loop”. Desired results are: Do While user input to InputBox “NewSize” <> False ‘ User hit Enter, OK or Cancel with no input If no user input put up MsgBox 1 On OK, Loop back to entry point On valid user input (anything => 0), exit Loop to next...
  16. 1

    VBA Do while loop problem

    Hi, I have a sheet where I want the contents of row G (where it has contents) to copy itself to the corresponding row in column A until the code has gone right through column G. The first such item is in row 1383 column G and occurs randomly down the rest of the spreadsheet. I've tried writing...
  17. K

    How to capture date fields based on a condition

    Hey guys I have import data that will come in as dates. I am looking to get the dates noted in a column, or multiple columns if there are many breaks in the date. When I mean breaks I mean in the example below the dates are consistent (B1 is 1 day earlier then A2) this continues until B3 and...
  18. O

    Do While? Or LBound Ubound?

    Hi, I have a macro, that my Book2 fetches datas from reference workbooks Book1 and Book3. If i write to for loop 10 instead of 3, the code looks for Book4 to Book10, and just because this workbooks don' t exist in my path, the code gives an error eventually. Is it possible to ignore this...
  19. Z

    Array in condition of Do While loop in VBA

    Please help me understand where my syntax is wrong here! I'm a beginner in vba but am learning fast. I'll try to simplify the problem below. I have created an array called myArray(). It has 5 values, 1,2,3,4, and5. I've confirmed the array was created successfuly. I then have a loop where h is...
  20. B

    Do while with IF

    Hi, I need to do a couple of do whiles with an IF that validate if a cell it's equal to a number (locations codes) then delete the entire row, (I need them in 2 different macros) And the issue is that I have 90 locations codes (for now) So, how can I create this kind of "database" as simple...

This Week's Hot Topics

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
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 "".
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