for each

  1. L

    Apply code to all but one worksheet in workbook

    I create a daily summary report each day that includes a pivot table with several worksheets based on filter pages within the pivot table. The pivot table includes a worksheet called "Executive Speeding Report" and "PT". Essentially the Executive Speeding Report worksheet contains the "raw" data...
  2. Johnny Thunder

    VBA Help - Rewrite a For Each Statement

    Hello all, I am working on a project and realized I messed up one piece of code but I was able to spot the problem. Here is what I have come up with, I have a For Each statement that scans my data and when there is a negative amount in column ("H2:H" & LastRow) process a few actions +...
  3. sdrowsick

    VBA Loop Issue

    Hello! I'm new here, so please let me know how I can best improve for future posts... My question is about a VBA loop in a file. I am trying to create a program that takes all the cells in a range (the range is a dynamic named range, but for this example, it's 269 rows and 37 columns), checks...
  4. Johnny Thunder

    VBA Help - Rewrite my Loop in a different order

    Hello All, Need some help with my loop code, currently it works great for the first loop, the issue I am having is that I am using a .Find Method to search a column for a value (Currently working great) problem is that once I Declare the found variable the code process a few updates based on...
  5. S

    Simple Loop for Formatting Headers

    Hi, Beyond new to VBA and macros. I'm trying to put together some simple code to loop through all sheets, excluding sheet 1, to format a varied range of cells in each sheet (if the cell has text, format it). I've been reading through all the forums and it seems like it should be simple. But...
  6. 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...
  7. 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)...
  8. 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...
  9. 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...
  10. 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...
  11. 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...
  12. 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...
  13. 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...
  14. 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...
  15. 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...
  16. 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...
  17. 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...
  18. 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...
  19. 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...
  20. 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...

Some videos you may like

This Week's Hot Topics

Top