MikkelDuif
New Member
- Joined
- Nov 26, 2016
- Messages
- 9
Hi,
I am new to VBA, and have searched the forum a lot, but I couldn't find a solution that exactly matches what my code requires.
What I basically want to do, is to loop through a lot of cells in a column, and if a condition is met, I want to copy the two cells next to it in to another sheet, and paste values.
The sheet updates automatically from an online table, so I later need to make it repeat the process all the time.
Here is an example:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]A: Condition[/TD]
[TD]B: Name[/TD]
[TD]C: Price[/TD]
[/TR]
[TR]
[TD]now[/TD]
[TD]Name 1[/TD]
[TD]18[/TD]
[/TR]
[TR]
[TD]later[/TD]
[TD]Name 2[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]later[/TD]
[TD]Name 3[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]later[/TD]
[TD]Name 4[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]now[/TD]
[TD]Name 5[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]now[/TD]
[TD]Name 6[/TD]
[TD]25[/TD]
[/TR]
[TR]
[TD]later[/TD]
[TD]Name 7[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]later[/TD]
[TD]Name 8[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]later[/TD]
[TD]Name 9[/TD]
[TD]12[/TD]
[/TR]
</tbody>[/TABLE]
So, the table updates automatically with a connection from my company, and the condition is calculated from criterions using the IF formula. But what I want to get my code to do, is that, if A says now, then I want to copy B and C in the second row to a new sheet. If it says later, it should just skip it.
Sadly, I cannot use the lookup function without code, as the data updates, and I need to get the prices as the condition is met, and get them into 'static text' that is not based on any function (such that my new table doesn't change all the time, as the data updates).
Hope someone can help me a bit. I have watched a few tutorials as well, but couldn't find anything that exactly matched this, and was not able to modify coded, such that it matched.
I am new to VBA, and have searched the forum a lot, but I couldn't find a solution that exactly matches what my code requires.
What I basically want to do, is to loop through a lot of cells in a column, and if a condition is met, I want to copy the two cells next to it in to another sheet, and paste values.
The sheet updates automatically from an online table, so I later need to make it repeat the process all the time.
Here is an example:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]A: Condition[/TD]
[TD]B: Name[/TD]
[TD]C: Price[/TD]
[/TR]
[TR]
[TD]now[/TD]
[TD]Name 1[/TD]
[TD]18[/TD]
[/TR]
[TR]
[TD]later[/TD]
[TD]Name 2[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]later[/TD]
[TD]Name 3[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]later[/TD]
[TD]Name 4[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]now[/TD]
[TD]Name 5[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]now[/TD]
[TD]Name 6[/TD]
[TD]25[/TD]
[/TR]
[TR]
[TD]later[/TD]
[TD]Name 7[/TD]
[TD]7[/TD]
[/TR]
[TR]
[TD]later[/TD]
[TD]Name 8[/TD]
[TD]9[/TD]
[/TR]
[TR]
[TD]later[/TD]
[TD]Name 9[/TD]
[TD]12[/TD]
[/TR]
</tbody>[/TABLE]
So, the table updates automatically with a connection from my company, and the condition is calculated from criterions using the IF formula. But what I want to get my code to do, is that, if A says now, then I want to copy B and C in the second row to a new sheet. If it says later, it should just skip it.
Sadly, I cannot use the lookup function without code, as the data updates, and I need to get the prices as the condition is met, and get them into 'static text' that is not based on any function (such that my new table doesn't change all the time, as the data updates).
Hope someone can help me a bit. I have watched a few tutorials as well, but couldn't find anything that exactly matched this, and was not able to modify coded, such that it matched.