loop 2 ranges

  1. M

    Compare individually the values from two different size ranges

    Hello! Let’s say range1is a spilled range that contains 3 values. We have another range called range2 that is fixed and contains 5 elements. I want to compare first value=20 from range1 with all the values from range2 and get first value that is greater or equal to 20. After this, go to the...
  2. L

    GoalSeek in Loop

    I am trying to use GoalSeek in excel, however my problem is that the goal for goal seek changes based on goal seeks selected answer. Below I have a code that loops through goal seek, each time setting the goal to an updated value. There are many instances where this code works however, there are...
  3. C

    Vba loop copy + paste to another range on same sheet

    Hello all. I hope everyone is safe. I need help on creating a Macro to cut cell from range 1 to paste cells on range 2 on same sheet Example: When i click on a button it will cut cells from A1 to C1 and paste on F1 to G1 Next each click goes through the table and do the same for the next until...
  4. I

    Nested For Each Statement: Identifying Key words from Range within a Range

    Dear Mr Excel I would be so grateful for some help with this. I have 4 Sheets that contain data that i am trying to write a code for. MessagesSheet (Which is named "replies" followed by "date" and "time"): This contains text messages received. The data is organised as follows: Each row...
  5. T

    Search and Match from a range + Loop + VBA

    Hi I´m sitting with a job-task I would like ideas on. I got two tables. See picture attached. 1. "Pricelist" with product-numbers and prices (Column B+C) 2. "Brochure" that contains same information. (F+G) I need to update prices from my "Pricelist" to my "Brochure". My idea: 1. Search...
  6. CubaRJ

    VBA to Color Each Cell in a Range to show OnDuty and other color to show OffDuty

    Hi! I need help to build a loop that will paint a row in a color to show on duty dates and another loop to paint the off duty. The idea is to have a button to fire up the color based on user´s settings for OnDuty, OffDuty and Rotations, I have set a minishet for better understanding...
  7. S

    Loop through a range, then "find" in another range

    Hi, It's been a few years since I've done any vba coding and I can no longer stitch together small codes by searching for answers across different forums - so I'm hoping someone will be able to help me with the entire code... What I need is: 1) In row 4, if the value in the first month being...
  8. E

    Loop works on 1st cell in range but then stops...any suggestions?

    Hi All, I am trying to loop thru each account in my account master, find the range of cells 7 rows over in the next tab, copy those cells into a calculation sheet with a multiple the values, then I want to paste the end result back into my account master sheet. I am able to get the 1st account...
  9. A

    Finding the text and moving Next cell

    Hi All, Thank for your support for learning for VBA I have a small problem, I find the text and copy 7 cell in the Active sheet but code not move Next finding. This my code Cells.Find(What:="Date", After:=ActiveCell, LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows...
  10. B

    Loop through variables which defined as range

    Hello, how can I loop through ranges. What I have already tried so far. Is it possible? Dim Variabel as Range Dim Variabel_1 as Range Dim Variabel_2 as Range Dim Variabel_3 as Range Dim I as Long ' the ranges are as an example Set Variabel_1 = Range("A1") Set Variabel_2 = Range("B5") Set...
  11. B

    VBA - Combine All Variations Between Multiple Lists

    Hi, Below is an example of what I am trying to accomplish, along with my current code at the bottom. I am trying to create a tool that will loop through multiple lists, generating each unique combination between them. The current code currently works close to expectation but there are 2 issues...
  12. B

    VBA: Looping to check for non-matches then appending to a list when record not matched

    Hello, I have two sheets in which I am trying to append records from one to the other. The main list is ws2 and the second list, ws5, is the one to be populated with records from ws2 by appending record i to the last row in the list. Records are only to be appended where they do not exist in...
  13. S

    Looping problem -

    Greetings Experts, I'm trying to look at the value of a cell in a range. In this case, the range is range("AK2", range("AK" & myLastRow) If the cell contains "L" input =IF(AL2=AJ2,TRUE, FALSE)) - 3 cells down (in "AN2") if the cell contains "KG" input...
  14. J

    Loop through Range

    Hello I am after some best approach advice. I have a list of transaction data in Sheet1 and a list of customers in Sheet2. I would like to return in 4 individual columns in Sheet2 next the the customer ID the four latest transactions. Which is the best approach than doing two loops. Is there a...
  15. S

    Loop 2 Ranges - "Invalid Next Control Variable Reference"

    In layman terms, what I'm trying to do: If "V2" = "A2" then "V2" = "True" Else "V2" = "False" Then proceeding to the next row in both ranges, all the way to the bottom of the data set. Sub Step6() Dim mycell As Range Dim myrange As Range For Each mycell In Range("V2", Range("V"...

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