Related:
- Search 4 worksheets, copy rows to 5th
- 4 elements trainer - Download - Adult games
- Diablo 4 free download - Download - Role playing
- Gta 4 download - Download - Action and adventure
- Pluraleyes 4 download - Download - Video editing
- Left 4 dead 2 download - Download - Shooters
1 response
So, you loop through the variables, and you are only keeping track of tocopy once. You need to build an array, so you know what number is a tocopy. Like so: tocopy(c)=1
would load the tocopy counter, then loop though and get the value from the i counter.
if tocopy(i)=1 then paste_the_value_from_cell_i
Try that!
You could say tocopy=tocopy+t (or tocopy++), but that only keeps track of how many rows to copy, and not the particular row! Tocopy(c) will keep track of what rows, as each tocopy(n) can have a separate value (it is an array!) So you could in practice have
topcopy(1)=0 Actual cell (A1)
topcopy(2)=1 Actual cell (A2)
topcopy(3)=0 Actual cell (A3)
topcopy(4)=1 Actual cell (A4)
This array would get the values out in the second loop and would copy the values of: A2, and A4
Make certain you reference the value to load from cell when you load the array, dont make the code save both the array variable (1), then look for the data (a1). Load the data at the time you know you want to copy it.
Example:
If InStr(c.Text, strsearch) Then
topcopy(c)=c.text
Now loop the array, and you get your copied data!
would load the tocopy counter, then loop though and get the value from the i counter.
if tocopy(i)=1 then paste_the_value_from_cell_i
Try that!
You could say tocopy=tocopy+t (or tocopy++), but that only keeps track of how many rows to copy, and not the particular row! Tocopy(c) will keep track of what rows, as each tocopy(n) can have a separate value (it is an array!) So you could in practice have
topcopy(1)=0 Actual cell (A1)
topcopy(2)=1 Actual cell (A2)
topcopy(3)=0 Actual cell (A3)
topcopy(4)=1 Actual cell (A4)
This array would get the values out in the second loop and would copy the values of: A2, and A4
Make certain you reference the value to load from cell when you load the array, dont make the code save both the array variable (1), then look for the data (a1). Load the data at the time you know you want to copy it.
Example:
If InStr(c.Text, strsearch) Then
topcopy(c)=c.text
Now loop the array, and you get your copied data!