for each

  1. Johnny Thunder

    VBA Help - If Cell Contains Partial String Then.......

    Hello all, Have a question that I thought I could easily answer but for whatever reason it doesn't seem to be working so another pair of eyes may help. I have a For Each Cell in Range Statement that looks at a Doc Type (2 Digit Variable) and when it finds "KR" to Search a Offset Cell for...
  2. 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)...
  3. J

    Multi Range, Multi Criteria Search VBA - Hide/Unhide Columns

    Hi All, Have a worksheet with a lot of data and I'm building a search VBA that hides/unhides columns based on 2 cells containing user entered data (from drop down menus). The first "For" function works without a problem, its easy since it's reading from a range with a single row, the second...
  4. Johnny Thunder

    VBA Help - Cell1 = Cell2 But if Cell 1 is blank return blank - Excel 2016

    Hello! I am kinda stuck on something so I will explain what I am doing. I have a Form that looks kinda like a Web portal with 18 fields/dropdowns that a user can populate. This tool also has the ability to recall these fields if the user knows the tracking number, then all the fillable...
  5. Johnny Thunder

    VBA Help - Combine 2 Macros in One - Excel 2016

    Hello All, I am working on a piece of code that loops through a range of cells and builds a Cell with data. I have the code working fine but I was not sure how to write the code in a way that I could have the code do 4 loops with varying column placement (C = #) . So as a workaround, I just...
  6. Johnny Thunder

    VBA Help - How to update Range based on Filtered Criteria - Excel 2016

    Hello All, I have come to a spot in this code that I am not sure how to tackle. I will do my best to explain what the problem is, I have one code that is able to be triggered from 3 different sheets, the outcome for all three sheets is the same, the only thing that varies is the data that...
  7. Johnny Thunder

    Vba Help - For Loop to enter Text into Cell - Excel 2016

    Hello all, I am working on a project and I have gotten fairly far with this and needed some guidance and possibly some revisions to my code to make it faster and shorter. Objective: 1. I have a Master Data Sheet (Ws2) that has 17 rows of data Columns("B:O"). Thru a loop on Column B, if the...
  8. P

    For Each Loop and Functions

    I imagine this is painfully simple, yet all my research and trying to figure it out on my own has led to failure. I've learned how to create a button in Excel and create code in VBA to have that button change cell values. The problem is that right now I only know how to affect one cell at a...
  9. VBE313

    Can anyone think of a better way to write this VBA or to turn it into a UDF?

    Sub test4opsgroup() Application.ScreenUpdating = False ActiveSheet.unprotect Dim cl As Object Dim l As Long, strCells As String Dim strpart As String Dim min As Range Dim numrows As Long Dim numcolumns As Long Dim partnum As Range Dim Qty As Range ActiveSheet.Range("T2").Select For Each...
  10. VBE313

    UDF For Each to end after certain range

    I was thankful enough to receive a UDF from Rick Rothstein. https://www.mrexcel.com/forum/excel-questions/1101059-udf-sum-until-certain-column-not-blank-again-post5294214.html#post5294214 I was wondering if someone can help me and figure out a Do Until a certain range, I have to uses over 30 of...
  11. S

    VBA - Unable to manage 3rd loop where MsgBox works

    Hi What I am trying to do is match a team name from a cell in range "B8:J8" with a team name on a separate page in the range "C2:C337". From those matches I want to determine the highest score and return that in a cell in range B20:J20 So for each team name in B8:J8 return the highest score...
  12. Johnny Thunder

    VBA to populate a Summary based on a Matrix of Variables

    Hello All, I am working on a project that has a summary sheet with some finance categories (see sample data below) using a matrix I have defined what Cost Centers and G/L Accounts​ are used to calculate the categories total. This is simple to do on a 1 cost center & 1 G/L Account basis using...
  13. Johnny Thunder

    VBA Help - Creating Multiple Variations of the same formula based on a List

    Problem: I have a Matrix of G/L accounts & Cost Center Variables. There is a possibility of 20 Cost Centers and 20 G/L Account Combinations for each of my Categories. 1. For each category, there are a 20 Possible Cost Centers as well as 20 G/L Account variations. 2. I need a way to...
  14. J

    Skip next iteration in loop - For Each - If/Then

    I've created a license tracking excel for my company where we track what state our employees are licensed in and the expiration date. Since there are are several counties that require different licensing the list is fairly long (over 100 rows). I'm trying to write a Looping VBA that will hide...
  15. Johnny Thunder

    VBA Help - Loop to Select Range and Apply to a working Macro - Excel 2016

    Hello All, I am working on automating a Journal Entry Tool and could use some help with the last part of my tool. In need of code that will loop thru a range of cells and find a matching value to the Business Unit and log the cell.address in a sum formula. Full Description: 1. Column A is...
  16. I

    Worksheets Names array with For Each

    I'm sure I am missing something very simple, but I cannot get this code to work properly. For the purpose of this example, let's say I have a workbook with 10 worksheets, each worksheet named with a different color. I want to use an array of three worksheet names ("Red", "Blue" , "Green") and...
  17. Johnny Thunder

    VBA Help - For Each Statement to Build a Formula based on Cell Values

    Hello All, I am working on a dropdown list that will create a formula thru vba to do a validation based on a dropdown list value true or false, true being the range needs to be added to my sum formula. Here is the dropdown list below, just need help with writing code to do this kind of...
  18. W

    VBA - Search string left, offset and remove found string

    Hello wise people of the internet. I'm tinkering with a code in VBA. It's purpose is to look at each cell in a given range. Part 1: Looking at the LEFT side of a string, it searches for "/56-Test1/" And it MUST be the first part of a string. Example: "A/56-Test1/AAA" should be ignored while...
  19. J

    How might I reference the cell currently being looked at within a `For Each` loop?

    I am currently trying to learn the basics of VBA and have been using the following code to work on a column of cells For Each foo In Range("A1", "A20") * Code * Next How might I return the cell being referenced at each iteration of this loop? For example, suppose cells A1 to A20...
  20. J

    For Each not looping through worksheets

    Hi! I am trying to consolidate data from multiple workbooks into one sheet in workbook. For some reason, I cannot get excel to loop through those every sheet the workbook and copy the data. I am including my code below. Any suggestions would be appreciated! Sub BOCIndex() Workbooks.Open...

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