for loop dynamic range

  1. airforceone

    Dynamic Cell Address on Countifs inside For Loops

    Good day mate! Need help to make my row criteria dynamic For iCtr = 2 To LastRow ActiveSheet.Range("F" & iCtr).Formula = "=SUM(COUNTIFS('XVList'!$E$2:$E" & LRow & ",$A2,'XVList'!$H$2:$H" & LRow & ",""Female""))" Next iCtr how can I make dynamic entry for ",$A2,", what my...
  2. D

    For cells in a column: how can I change Interior.Color of EntireRow based the font.color?

    Hi Folks, I'm trying to format my dynamic excel table, so that IF text in a cell in column A is colored white, then the entire row--within the table boundary only---will have Interior.ColorIndex = 25. The only code I've managed to use to successfully change a row within a table to a different...
  3. R

    Finding Last Row/Column to Hide other Cells

    Hello, I am trying to finding the last row with a value. -I know how to do this typically by using "xlUp" but for some reason it is stopping at a cell that does not contain a value but just a change in color. -I am now trying to find a different way to go about this. Instead, I want to...
  4. T

    Pass value from function to be used as the number of time to iterate For loop

    The iteration's value is the number of times I want to loop an action. This value is sent from a function, and for some reason, it is not looping as it should. Here's my working code. Function looking() Dim it As Integer Dim n1 As String, n2 As String, aCur As String, preV As String, rng As...
  5. W

    Loop through a range populating with a dynamic formula to sum a row

    Hi All, I hope that I'm just missing something simple here -- I can't get the following code to work. Sub sumfornondddgrid() Dim lastrow As Integer Dim lastcolumn As Integer Sheets("02Grid by Dept and GLCode").Activate lastrow = Cells(Rows.Count, "B").End(xlUp).Row lastcolumn = Cells(1...
  6. C

    Macro loop not working

    Hi, I need a macro with following conditions, 1) If cells in column A is equal to any one of the cells in column G then 2) The corresponding cell value in column C should say "Match" 3) If not, the correcsponding cell value in column C should say "Not Match" I am a beginner in Macro and I have...
  7. S

    For loop not exiting with Exit For

    Hello people, I have this code that loops through the cells of a single row. For some reason, the "Exit for" is not working making vba copy the string to the 33 cells. Ideally, this code should check the looped cell if it is equal to the string. If not, just paste it on the next available cell...
  8. J

    ForEach Maybe... Or just basic excel help

    I am new to visual basic and I have been using the record macro feature to try and learn how it works but I have run into an issue. I have a list of values in column J that varies in length per sheet and I want each cell in column J that has a value to run through a macro. Placing the value from...
  9. R

    Do I need a nested for Loop?

    Hi, I am hoping to get pointed in the right direction. I am going to attempt to write a macro with three sheets. Transactions, Accounts, and Output. On the transactions tab all of the companies with company ID (col A), the transaction amount (col E), Description (col D) and date (col B) will...
  10. B

    Update dynamic range in For...Loop?

    Hi guys I've simplified the code but having trouble with the following... for c = 3 to Range("A65536").end(xlup).row if cells(c,2).value = true then rows(c).insert end if next Basically because I am inserting row during the procedure the loop only remembers the initial...

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