for each

  1. P

    Formula for average of all networkdays values between 2 columns

    Hi, I have this formula to find the difference between dates minus the weekends. =IF(ISNUMBER(N2),MAX(0,NETWORKDAYS(M2,N2,)-1),"") I have been putting it in an empty cell and filling down. Then in another cell I average that column. My question is can I write one formula in one cell that...
  2. D

    Looping Through Worksheets

    Hi Everyone.. I have a workbook named "Klaus", with a number of worksheets.. The first sheet it named "Ark" further I have a number of other worksheets with the same structure as shown here: (The solumns are A to C..) <tbody> ID Year Weight 134 2004 20 123 2004 17 543 2004 13 247...
  3. L

    Copy cells from 1 sheet to another in a loop using a different starting and ending position

    Hi could you please help me with this loop. I’m trying to copy all cells from my current sheet starting at “B9” down. To a New sheet Starting at cell “A34” I marked out the 2 areas where I’m stuck. Thanks Range("B9").Select ‘ starting point Dim x As Variant Dim Icount As...
  4. D

    copy whole row starting from row # 2 on other sheet when the value in a column on 1st sheet is 100

    Hi I want to copy the whole row to the second sheet in the same workbook when the marks are 100. Please help with the code thank you very much in advance. <COLGROUP><COL style="WIDTH: 48pt" span=3 width=64><TBODY> .Student Subject Marks xya English 100 abc Hindi 20 uhs Japanese 100...
  5. D

    Loop Help Needed

    I am looping through a named range (Log) to see if the cell value matches a variable that I enter an inputbox and then if an offset cell matches another variable that I enter in a second inputbox. My problem is that even if the matches are found the Msgbox still pops up and I exit the sub. I...
  6. T

    using vba to hide certain rows based on their value

    hi. What I want to achieve: Look at column B range. For each cell it could be 0 or a number. If 0, I want to hide that entire row. If not 0 I want to show that row. (Later I will also want to show the rows relating to the numbers in B.) Sub HidingMatchedRowsWithRangeSelection() 'To select a...
  7. P

    How to use the cell selected by an inputbox and use it to loop through all files/workbooks

    Hello, I am attempting to figure out how to prompt the user to type in the cell label he/she wants from an inputbox and then automatically use that same cell address in all the files I want to loop through. I want to prompt the user only once, and not every time the code loops through each...
  8. K

    For Each loop with Dim as Long - Run-time error '6' Overflow

    Hi all I'm struggling a bit with a Run-time error '6' Overflow. My code is only able to handle 32.767 cells so I assume the reason is a default Dim As Integer. If so I guees I only need to have Dim changed to Long but for some reason I can figure out how to do this in my For Each loop. And as...
  9. C

    Find Most Frequent Occurence

    I am trying to develop a query that pulls the most common occurring name. There is a table that stores shipments based on a carrier, customer and the account manager. I am trying to determine for each carrier which account manager appears most. How would I go about this? Thanks,
  10. B

    Finding all pivottables in a workbook using for each loop - 424 error

    Hi all, I'm new here, so forgive me if any formatting isn't right the first time! I hope you guys can help me out with the following issue: I'm trying to find all pivottables in a workbook using the following code. The goal is to instruct the found pivottables further on, but first I need to...
  11. L

    Excel macro to remove duplicates within a group

    Hi, I'm struggling to write a multidimensional array. Could you please help? Here is what I’m trying to do... With alot of help I was able to write a OBject dictionary in a loop that removes dupes. During this build I did not take into account that I needed to restart the loop whenever the...
  12. S

    Loop through of sheets and execute calculations based on dynamic sheet references

    Greetings, Is it possible to loop through a list of sheets and execute some calculations that have sheet references from a different list of worksheets? For example, you have a list (list 1) of your worksheets, which will be the destinations of the calculations, and you have a second list...
  13. B

    Using Find method in For Each Loop - Object Variable or With Block Variable Not Set

    Hi There, I'm having a hard time figuring out why I'm getting the subscript out of range error on the following code. All I'm trying to do is use the search terms I have stored in the range "SearchTerm" to find any values that are in the range ToSearch. The lines outside of the the For Each...
  14. Prevost

    Looping through all WS in WB not working using For

    Hi There. My code below is supposed to highlight all the rows of the cells in a specified range (in column B) that begin with a letter. I am trying to loop through all the worksheets in the workbook and am using the FOR counter from 2 to the end of the WS. However, it only works on the active...
  15. savindrasingh

    Can For Each change cell contents without any code to do so?

    I am facing a strange problem with For Each Loop. While debugging my code I have found that as soon as I enter the line highlighted below (having For Each Associate In empList) it is changing the cell contents with user's display name without even running the code? It is so strange, I am not...
  16. V

    Vince

    I am learning VBA for excel. I have need to add hyperlinks to a series of some 4000 cells.Each is based on a identical cell pattern in sequential worksheets. So far I have tried the following: Range("B2").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, address:=""...
  17. S

    For Each and If loops

    Hi everyone, below is the code I am using and for some reason every other time I change the numbers in rng5 and rng6 the loops will execute and run correctly but not every time (I change the number it runs correctly, i change the number again it doesnt run, i change it again and it runs...
  18. J

    Loop through multiple ranges

    First off, thanks for looking at this. I am having a problem trying to figure out ow to move to the next set of cells. I have a list of data on say Sheets("Sheet1") that I need, starting in BA8 that goes down 6 rows to column DW. I need to loop through each columns set of six cells, copy and...
  19. B

    Data being Placed in Incorrect Cell

    Hi, my code is behaving in a way that I did not at all expect. What I was hoping it would do is go down column A and then apply a label and add a value depending on what is in the cell. If the cell is empty, then it will get a label and then in column B, a number would be added. If the name...
  20. B

    Creating a range with variable length

    Hi, I'm trying to write a code that finds the next empty cell in Column A and then sets that as a range. Once that is complete, I want to create a For Each loop for that range. So far what I have is: Range("A1").Select ActiveCell.End(xlDown).Select For Each c In [A2:ActiveCell.Address]...

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