for loop dynamic range

  1. 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...
  2. 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...
  3. 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...
  4. 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...
  5. 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...
  6. 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...
  7. 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...
  8. 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...

Some videos you may like

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...
Top