if loop

  1. C

    VBA Find variable in another set of variables

    I have 2 lists of data and I need excel to go through one list and search for the contents of each cell in the other list and when it finds it, to then copy the cell next to it. I've started with... Sheets("Example").Select MyARange = "A1:A134933" For each MyACell in Range(MyARange)...
  2. M

    Loop with an if Statement

    Hi, At the min I have created the below sub which creates the data in the format which I require overall. However I would now like to split this data up in the loop based on criteria below into 4 different tabs based on the outcome of the statement. At the min the entire data is pasted on the...
  3. D

    If loop skipping criteria

    Hi guys, I'm trying to write code which checks if the column "Status" in "yTable" has the string "yes" in it. if it does, i want it to do a series of things, if not, then I want it to go to a different sheet and do that. This is what I have so far. If "yTable[[Status]:[Status]]" = "yes" Then...
  4. D

    blank cells if loop

    Hi guys, im trying to fill all the blank cells in a selected range with the text "no data". however, im doing a monthly report, and its not necessary for each month to have blank cells. so how can I make an if loop where it checks if blank cells exist in the range, if they do, fill with "no...
  5. 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...
  6. R

    Trying to use Today() function in an IF loop

    I'm attempting to delete rows with dates beyond tomorrow's date with the following code: Do While Not IsEmpty(ActiveCell) If ActiveCell.Value = TODAY + 1 Then Selection.EntireRow.Delete Shift:=xlUp Else ActiveCell.Offset(1, 0).Select End If Loop End Sub It doesn't...
  7. J

    Understanding IF loops.

    Hello again, I am just starting VBA and trying to practice loops. Can you please help me understand why this code works: For startingnumber = 1 To endingnumber If startingnumber = 1 Or startingnumber = 3 Or startingnumber = 5 Or startingnumber = 7 Or startingnumber = 9 Then...
  8. M

    Loop With If Then Statement

    Hello, I am attempting to create a loop that reads a text in column AC (29) and if the text matches my criteria it creates a vlookup in column AJ (36) that looks like the below vlookup. I am looking for the search to start in row 65 of the spreadsheet and read till the last value in column AC...
  9. A

    If function not working !!!

    If Range("C" & (i - 1)).Value + Range("C" & i).Value = 0 Then ActiveCell.Formula = (Range("D" & (i - 1)) + Range("D" & i)) / (Range("C" & (i - 1)) + Range("C" & i)) Else ActiveCell.Formula = "0.00%" End If This is not working !! can anyone suggest where's the mistake? I am getting Overflow...
  10. B

    Generate Random numbers with out using predefined functions

    Ask the user for a positive integer (num), below 100. If the user enters a negative number or greater than 100, give a warning and ask to re-enter. Generate 20 positive random numbers between (1- num). Display the generated random numbers in the range (A1, A20). I know there are random number...
  11. E

    decimal value in if loop

    How to write simple IF loop? If A1 AND A2 <0.3 AND A3<0.42 THEN "OK" OTHERWISE "NOT OK" =IF(AND(A1<0.3;A2<0.3;A3<0.42);”OK”;”NOT OK”) -error in formula formula gives error,if I use only Decimal values(0.3,0.4 etc).How to correct this?
  12. M

    Calculate certain cells

    I thank you all in advance! I'm trying to color a cell in regards to circumstances. Item A1 max value should be 3000, if reaching 3000 or more, highlighted red. Item A2 minus A1, should act the same too. If A2 minus A1, were 3000 or more, A2 should be highlighted red. If it weren't, move on...
  13. S

    "on error" command not exiting if loop

    I want to look and see if a file exists (based on a date entered into an input box). If the file exists, I want to delete the file. If the file does not exist, I want the macro to move onto the next line without an error message. The code below works when the file exists but gets stuck on the...
  14. M

    Vlookup loop

    Is it possible to run VLOOKUP in a loop where it searches through the entire table. Example: A 1 B 2 C 3 A 4 <?XML:NAMESPACE PREFIX = H6,IF(VLOOKUP($E$8,Imported_Data!$A...

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